# TimeTrait

    struct TimeTrait

Represents several Time related attributes for the current Structure.
- `


  ### [identifier](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/TimeTrait#/s:15GoogleHomeTypes0A0O9TimeTraitV10identifierSSvpZ)


  ` The trait identifier.

  #### Declaration

  Swift

      static let identifier: String

- `


  ### [supportedEventTypes](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/TimeTrait#/s:15GoogleHomeTypes0A0O9TimeTraitV014supportedEventC0Say0aB3SDK0G0_pXpGvpZ)


  ` List of the event types that are supported by `TimeTrait`.

  #### Declaration

  Swift

      static let supportedEventTypes: [any Event.Type]

- `


  ### [supportedCommandTypes](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/TimeTrait#/s:15GoogleHomeTypes0A0O9TimeTraitV016supportedCommandC0Say0aB3SDK0G0_pXpGvpZ)


  ` List of the commands that are supported.

  #### Declaration

  Swift

      static let supportedCommandTypes: [any Command.Type]

- `


  ### [metadata](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/TimeTrait#/s:15GoogleHomeTypes0A0O9TimeTraitV8metadata0aB3SDK0E8MetadataVvp)


  ` Metadata about this `Trait`.

  #### Declaration

  Swift

      let metadata: TraitMetadata

- `


  ### [init(decoder:interactionProxy:metadata:)](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/TimeTrait#/s:15GoogleHomeTypes0A0O9TimeTraitV7decoder16interactionProxy8metadataAE0aB3SDK0E7DecoderV_AI011InteractionH0_pSgAI0E8MetadataVtKcfc)


  ` Creates a new Trait instance using data read from the given `TraitDecoder`.
  Throws
  `HomeError.parseError` when parsing fails.

  #### Declaration

  Swift

      init(decoder: TraitDecoder, interactionProxy: (any InteractionProxy)?, metadata: TraitMetadata) throws

  #### Parameters

  |---|---|
  | ` decoder ` | The raw data representing this Trait. |
  | ` interactionProxy ` | Proxy to the Interaction Client. |
  | ` metadata ` | Metadata about this Trait. |

- `


  ### [encode(with:)](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/TimeTrait#/s:15GoogleHomeTypes0A0O9TimeTraitV6encode4withy0aB3SDK0E7EncoderC_tKF)


  ` Writes this object to the given `TraitEncoder`.
  Throws `HomeError.encodingFailed` if the data could not be encoded.

  #### Declaration

  Swift

      func encode(with encoder: TraitEncoder) throws

- `


  ### [update(_:)](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/TimeTrait#/s:15GoogleHomeTypes0A0O9TimeTraitV6updateyAEyAE17MutableAttributesCXEYaKF)


  ` Updates the attributes of the trait.

  #### Declaration

  Swift

      func update(_ block: (https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google.html.TimeTrait.MutableAttributes) -> Void) async throws -> https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google.html.TimeTrait

  #### Parameters

  |---|---|
  | ` block ` | The block to execute to update the attributes. |

  #### Return Value

  A new `TimeTrait` with the updated attributes.
- `


  ### [==(_:_:)](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/TimeTrait#/s:15GoogleHomeTypes0A0O9TimeTraitV2eeoiySbAE_AEtFZ)


  ` 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: https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google.html.TimeTrait, rhs: https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google.html.TimeTrait) -> Bool

  #### Parameters

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

- `


  ### [hash(into:)](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/TimeTrait#/s:15GoogleHomeTypes0A0O9TimeTraitV4hash4intoys6HasherVz_tF)


  ` Hashes the essential components of this value by feeding them into the
  given hasher.

  Implement this method to conform to the `Hashable` protocol. The
  components used for hashing must be the same as the components compared
  in your type's `==` operator implementation. Call `hasher.combine(_:)`
  with each of these components.
  Important

  In your implementation of `hash(into:)`,
  don't call `finalize()` on the `hasher` instance provided,
  or replace it with a different instance.
  Doing so may become a compile-time error in the future.

  #### Declaration

  Swift

      func hash(into hasher: inout Hasher)

- `


  ### [ScheduledEvent](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/TimeTrait/ScheduledEvent.html)


  ` The event that will be subscribed to when an automation needs to be scheduled.

  #### Declaration

  Swift

      struct ScheduledEvent

- `


  ### [RecurringClockTimeScheduledEvent](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/TimeTrait/RecurringClockTimeScheduledEvent.html)


  ` The event that will be subscribed to when an automation needs to be scheduled recurringly.

  #### Declaration

  Swift

      struct RecurringClockTimeScheduledEvent

- `


  ### [RecurringSolarTimeScheduledEvent](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Google/TimeTrait/RecurringSolarTimeScheduledEvent.html)


  ` The event that will be subscribed to when an automation needs to be scheduled recurringly.

  #### Declaration

  Swift

      struct RecurringSolarTimeScheduledEvent