    struct StateReader

    extension StateReader : Equatable, Hashable, Identifiable, https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/Node.html, https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/NodeWithOutput.html, Sendable, SendableMetatype

A class that accesses a trait's state, used for `https://developers.home.google.com/reference/swift/GoogleHomeSDK/Structs/Condition.html` instances.
- `


  ### [id](https://developers.home.google.com/reference/swift/GoogleHomeSDK/Structs/StateReader#/s:13GoogleHomeSDK11StateReaderV2idSSvp)


  ` The stable identity of the entity associated with this instance.

  #### Declaration

  Swift

      let id: String

- `


  ### [trait](https://developers.home.google.com/reference/swift/GoogleHomeSDK/Structs/StateReader#/s:13GoogleHomeSDK11StateReaderV5traitAA5Trait_pXpvp)


  ` The `https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/Trait.html` associated with the `StateReader`.

  #### Declaration

  Swift

      let trait: any https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/Trait.html.Type

- `


  ### [traitID](https://developers.home.google.com/reference/swift/GoogleHomeSDK/Structs/StateReader#/s:13GoogleHomeSDK11StateReaderV7traitIDSSvp)


  ` The string-based identifier for the `https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/Trait.html`. If trait is `https://developers.home.google.com/reference/swift/GoogleHomeSDK/Structs/UnknownTrait.html`
  it will refer to the original `https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/Trait.html` ID provided.

  #### Declaration

  Swift

      let traitID: String

- `


  ### [output](https://developers.home.google.com/reference/swift/GoogleHomeSDK/Structs/StateReader#/s:13GoogleHomeSDK11StateReaderV6outputSSvp)


  ` The unique ID for the `StateReader` node output. Must be unique per `https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/Automation.html`.

  #### Declaration

  Swift

      let output: String

- `


  ### [entityExpression](https://developers.home.google.com/reference/swift/GoogleHomeSDK/Structs/StateReader#/s:13GoogleHomeSDK11StateReaderV16entityExpressionAA0G0_pvp)


  ` An expression that selects an entity or a list of entities associated
  with the `StateReader` at runtime.

  When entityExpression represents a single explicit entity, entityExpression will be Constant(value: AnyAutomationEntity).
  Otherwise, entityExpression is an expression, capable of resolving to any number of entities.

  #### Declaration

  Swift

      let entityExpression: any https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/Expression.html

- `


  ### [entity](https://developers.home.google.com/reference/swift/GoogleHomeSDK/Structs/StateReader#/s:13GoogleHomeSDK11StateReaderV6entityAA0B6Object_pSgvp)


  ` The unique entity for the `https://developers.home.google.com/reference/swift/GoogleHomeSDK/Structs/HomeDevice.html` or `https://developers.home.google.com/reference/swift/GoogleHomeSDK/Structs/Structure.html` associated
  with the `StateReader`.

  entity will be nil if the init(entityExpression: ...) was used and
  the entityExpression is not a `https://developers.home.google.com/reference/swift/GoogleHomeSDK/Structs/Constant.html` to an `https://developers.home.google.com/reference/swift/GoogleHomeSDK/Enums/AnyAutomationEntity.html`.

  #### Declaration

  Swift

      var entity: (any https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/HomeObject.html)? { get }

- `


  ### [deviceType](https://developers.home.google.com/reference/swift/GoogleHomeSDK/Structs/StateReader#/s:13GoogleHomeSDK11StateReaderV10deviceTypeAA06DeviceG0_pXpSgvp)


  ` The identifier of the `https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/DeviceType.html` associated with the `StateReader`,
  if the entity is a device.

  deviceType will be nil if entity is nil or not a device, such as a `https://developers.home.google.com/reference/swift/GoogleHomeSDK/Structs/Structure.html` or `https://developers.home.google.com/reference/swift/GoogleHomeSDK/Structs/Room.html`.

  #### Declaration

  Swift

      var deviceType: (any https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/DeviceType.html.Type)? { get }

- `


  ### [deviceTypeID](https://developers.home.google.com/reference/swift/GoogleHomeSDK/Structs/StateReader#/s:13GoogleHomeSDK11StateReaderV12deviceTypeIDSSSgvp)


  ` The string-based identifier for the `https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/DeviceType.html`. If deviceType is `https://developers.home.google.com/reference/swift/GoogleHomeSDK/Structs/UnknownDeviceType.html`
  it will refer to the original deviceTypeID provided.

  deviceTypeID will be nil if entity is nil or not a device, such as a `https://developers.home.google.com/reference/swift/GoogleHomeSDK/Structs/Structure.html` or `https://developers.home.google.com/reference/swift/GoogleHomeSDK/Structs/Room.html`.

  #### Declaration

  Swift

      var deviceTypeID: String? { get }

- `


  ### [==(_:_:)](https://developers.home.google.com/reference/swift/GoogleHomeSDK/Structs/StateReader#/s:13GoogleHomeSDK11StateReaderV2eeoiySbAC_ACtFZ)


  ` Returns a Boolean value indicating whether two values are equal.

  Equality is the inverse of inequality. For any values `a` and `b`,
  `a == b` implies that `a != b` is `false`.

  #### Declaration

  Swift

      static func == (lhs: StateReader, rhs: StateReader) -> Bool

  #### Parameters

  |---|---|
  | ` lhs ` | A value to compare. |
  | ` rhs ` | Another value to compare. |

- `


  ### [isEqual(to:)](https://developers.home.google.com/reference/swift/GoogleHomeSDK/Structs/StateReader#/s:13GoogleHomeSDK11StateReaderV7isEqual2toSbAA4Node_p_tF)


  ` Returns true if the nodes are equal, false otherwise.

  #### Declaration

  Swift

      func isEqual(to other: any https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/Node.html) -> Bool