    struct ChannelTrait

This trait provides an interface for selecting channels on a device or endpoint.
- `


  ### [supportedEventTypes](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait#/s:15GoogleHomeTypes6MatterO12ChannelTraitV014supportedEventC0Say0aB3SDK0H0_pXpGvpZ)


  ` No supported events for `ChannelTrait`.

  #### Declaration

  Swift

      static let supportedEventTypes: [any Event.Type]

- `


  ### [supportedCommandTypes](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait#/s:15GoogleHomeTypes6MatterO12ChannelTraitV016supportedCommandC0Say0aB3SDK0H0_pXpGvpZ)


  ` List of the commands that are supported by `ChannelTrait`.

  #### Declaration

  Swift

      static let supportedCommandTypes: [any Command.Type]

- `


  ### [identifier](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait#/s:15GoogleHomeTypes6MatterO12ChannelTraitV10identifierSSvpZ)


  ` The trait identifier.

  #### Declaration

  Swift

      static let identifier: String

- `


  ### [metadata](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait#/s:15GoogleHomeTypes6MatterO12ChannelTraitV8metadata0aB3SDK0F8MetadataVvp)


  ` Metadata about this `Trait`.

  #### Declaration

  Swift

      let metadata: TraitMetadata

- `


  ### [attributes](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait#/s:15GoogleHomeTypes6MatterO12ChannelTraitV10attributesAE10AttributesVvp)


  ` List of attributes for the `ChannelTrait`.

  #### Declaration

  Swift

      let attributes: https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter.html.ChannelTrait.https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait/Attributes.html

- `


  ### [init(decoder:interactionProxy:metadata:)](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait#/s:15GoogleHomeTypes6MatterO12ChannelTraitV7decoder16interactionProxy8metadataAE0aB3SDK0F7DecoderV_AI011InteractionI0_pSgAI0F8MetadataVtKcfc)


  ` 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/Matter/ChannelTrait#/s:15GoogleHomeTypes6MatterO12ChannelTraitV6encode4withy0aB3SDK0F7EncoderC_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

- `


  ### [forceRead()](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait#/s:15GoogleHomeTypes6MatterO12ChannelTraitV9forceReadyyYaKF)


  ` This API provides the ability to invalidate state retrieved through subscriptions to the
  target device in the cases where state is not being reported correctly, either intentionally
  (e.g attributes in Matter traits with the "C" quality) or unintentionally due to poor
  implementations.

  When successful, this API will result in a forced read of the convening scope as specified by
  the sub-class and return the result through existing Trait subscriptions if present and
  active.

  This API is to be used sparingly as it can impact the performance and battery life of the
  target device. As such, this API may be throttled by the platform.
  Callers SHALL be prepared to deal with `HomeError`s thrown by this call.

  #### Declaration

  Swift

      func forceRead() async throws

- `


  ### [Attributes](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait/Attributes.html)


  ` Attributes for the `https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait.html`.

  #### Declaration

  Swift

      struct Attributes

- `


  ### [==(_:_:)](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait#/s:15GoogleHomeTypes6MatterO12ChannelTraitV2eeoiySbAE_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/Matter.html.ChannelTrait, rhs: https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter.html.ChannelTrait) -> Bool

  #### Parameters

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

- `


  ### [hash(into:)](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait#/s:15GoogleHomeTypes6MatterO12ChannelTraitV4hash4intoys6HasherVz_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)

- `


  ### [AdditionalInfoStruct](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait/AdditionalInfoStruct.html)


  ` Additional name-value pairs that can be used to identify content.

  #### Declaration

  Swift

      struct AdditionalInfoStruct

- `


  ### [ChannelInfoStruct](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait/ChannelInfoStruct.html)


  ` A channel in a channel lineup.

  #### Declaration

  Swift

      struct ChannelInfoStruct

- `


  ### [ChannelPagingStruct](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait/ChannelPagingStruct.html)


  ` The paging structure that includes the previous and next pagination tokens.

  #### Declaration

  Swift

      struct ChannelPagingStruct

- `


  ### [LineupInfoStruct](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait/LineupInfoStruct.html)


  ` A channel lineup.

  #### Declaration

  Swift

      struct LineupInfoStruct

- `


  ### [PageTokenStruct](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait/PageTokenStruct.html)


  ` The pagination structure.

  #### Declaration

  Swift

      struct PageTokenStruct

- `


  ### [ProgramCastStruct](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait/ProgramCastStruct.html)


  ` The cast information related to a program.

  #### Declaration

  Swift

      struct ProgramCastStruct

- `


  ### [ProgramCategoryStruct](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait/ProgramCategoryStruct.html)


  ` The category associated to a program.

  #### Declaration

  Swift

      struct ProgramCategoryStruct

- `


  ### [ProgramStruct](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait/ProgramStruct.html)


  ` A program within an electronic program guide (EPG).

  #### Declaration

  Swift

      struct ProgramStruct

- `


  ### [SeriesInfoStruct](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait/SeriesInfoStruct.html)


  ` The episode information related to a program.

  #### Declaration

  Swift

      struct SeriesInfoStruct

- `


  ### [supportsChangeChannelCommand](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait#/s:15GoogleHomeTypes6MatterO12ChannelTraitV014supportsChangeE7CommandSbvp)


  ` Whether the device supports the `changeChannel` command for this trait.

  #### Declaration

  Swift

      var supportsChangeChannelCommand: Bool { get }

- `


  ### [changeChannel(match:)](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait#/s:15GoogleHomeTypes6MatterO12ChannelTraitV06changeE05matchAE06ChangeE7CommandV8ResponseVSS_tYaKF)


  ` Change the channel to the specified channel.

  #### Declaration

  Swift

      func changeChannel(match: String) async throws -> https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter.html.ChannelTrait.ChangeChannelCommandResponse

  #### Parameters

  |---|---|
  | ` match ` | A string used to identify the intended channel, which may be a call sign, a name, or a number. |

  #### Return Value

  The status of the `ChangeChannel` command.
- `


  ### [changeChannelBatchable(match:)](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait#/s:15GoogleHomeTypes6MatterO12ChannelTraitV06changeE9Batchable5match0aB3SDK0H7CommandVyAE06ChangeeK0V8ResponseVGSS_tKF)


  ` The batchable version of changeChannel command above.
  See also
  changeChannel

  #### Declaration

  Swift

      func changeChannelBatchable(match: String) throws -> BatchableCommand<https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter.html.ChannelTrait.ChangeChannelCommandResponse>

- `


  ### [supportsChangeChannelByNumberCommand](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait#/s:15GoogleHomeTypes6MatterO12ChannelTraitV014supportsChangeE15ByNumberCommandSbvp)


  ` Whether the device supports the `changeChannelByNumber` command for this trait.

  #### Declaration

  Swift

      var supportsChangeChannelByNumberCommand: Bool { get }

- `


  ### [changeChannelByNumber(majorNumber:minorNumber:)](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait#/s:15GoogleHomeTypes6MatterO12ChannelTraitV06changeE8ByNumber05majorI005minorI0ys6UInt16V_AJtYaKF)


  ` Change the channel to the channel specified by `majorNumber` and `minorNumber`.

  #### Declaration

  Swift

      func changeChannelByNumber(majorNumber: UInt16, minorNumber: UInt16) async throws

  #### Parameters

  |---|---|
  | ` majorNumber ` | The channel major number value to which the channel should change, in ATSC format. |
  | ` minorNumber ` | The channel minor number value to which the channel should change, in ATSC format. |

- `


  ### [changeChannelByNumberBatchable(majorNumber:minorNumber:)](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait#/s:15GoogleHomeTypes6MatterO12ChannelTraitV06changeE17ByNumberBatchable05majorI005minorI00aB3SDK0J7CommandVyytGs6UInt16V_ANtKF)


  ` The batchable version of changeChannelByNumber command above.
  See also
  changeChannelByNumber

  #### Declaration

  Swift

      func changeChannelByNumberBatchable(majorNumber: UInt16, minorNumber: UInt16) throws -> BatchableCommand<Void>

- `


  ### [supportsSkipChannelCommand](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait#/s:15GoogleHomeTypes6MatterO12ChannelTraitV012supportsSkipE7CommandSbvp)


  ` Whether the device supports the `skipChannel` command for this trait.

  #### Declaration

  Swift

      var supportsSkipChannelCommand: Bool { get }

- `


  ### [skipChannel(count:)](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait#/s:15GoogleHomeTypes6MatterO12ChannelTraitV04skipE05countys5Int16V_tYaKF)


  ` Provides channel up and channel down functionality, by allowing the index of the selected
  channel to jump by the specified number of steps.

  #### Declaration

  Swift

      func skipChannel(count: Int16) async throws

  #### Parameters

  |---|---|
  | ` count ` | When positive, `count` specifies the number of steps to increase the current channel number. When negative, it specifies the number of steps to decrease the current channel number. |

- `


  ### [skipChannelBatchable(count:)](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait#/s:15GoogleHomeTypes6MatterO12ChannelTraitV04skipE9Batchable5count0aB3SDK0H7CommandVyytGs5Int16V_tKF)


  ` The batchable version of skipChannel command above.
  See also
  skipChannel

  #### Declaration

  Swift

      func skipChannelBatchable(count: Int16) throws -> BatchableCommand<Void>

- `


  ### [supportsGetProgramGuideCommand](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait#/s:15GoogleHomeTypes6MatterO12ChannelTraitV30supportsGetProgramGuideCommandSbvp)


  ` Whether the device supports the `getProgramGuide` command for this trait.

  #### Declaration

  Swift

      var supportsGetProgramGuideCommand: Bool { get }

- `


  ### [getProgramGuide(optionalArgsProvider:)](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait#/s:15GoogleHomeTypes6MatterO12ChannelTraitV15getProgramGuide20optionalArgsProviderAE03GethI7CommandV8ResponseVyAI08OptionalK0CYbcSg_tYaKF)


  ` Retrieves the program guide.

  #### Declaration

  Swift

      func getProgramGuide(optionalArgsProvider: (@Sendable (https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter.html.ChannelTrait.GetProgramGuideCommand.OptionalArgs) -> Void)? = nil) async throws -> https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter.html.ChannelTrait.GetProgramGuideCommandResponse

  #### Return Value

  The program guide response.
- `


  ### [getProgramGuideBatchable(optionalArgsProvider:)](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait#/s:15GoogleHomeTypes6MatterO12ChannelTraitV24getProgramGuideBatchable20optionalArgsProvider0aB3SDK0J7CommandVyAE03GethiO0V8ResponseVGyAL08OptionalL0CcSg_tKF)


  ` The batchable version of getProgramGuide command above.
  See also
  getProgramGuide

  #### Declaration

  Swift

      func getProgramGuideBatchable(optionalArgsProvider: ((https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter.html.ChannelTrait.GetProgramGuideCommand.OptionalArgs) -> Void)? = nil) throws -> BatchableCommand<https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter.html.ChannelTrait.GetProgramGuideCommandResponse>

- `


  ### [supportsRecordProgramCommand](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait#/s:15GoogleHomeTypes6MatterO12ChannelTraitV28supportsRecordProgramCommandSbvp)


  ` Whether the device supports the `recordProgram` command for this trait.

  #### Declaration

  Swift

      var supportsRecordProgramCommand: Bool { get }

- `


  ### [recordProgram(programIdentifier:shouldRecordSeries:externalIDList:data:)](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait#/s:15GoogleHomeTypes6MatterO12ChannelTraitV13recordProgram17programIdentifier18shouldRecordSeries14externalIDList4dataySS_SbSayAE20AdditionalInfoStructVG10Foundation4DataVtYaKF)


  ` Record a specific program or series when it goes live.

  #### Declaration

  Swift

      func recordProgram(programIdentifier: String, shouldRecordSeries: Bool, externalIDList: [https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter.html.ChannelTrait.https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait/AdditionalInfoStruct.html], data: Data) async throws

  #### Parameters

  |---|---|
  | ` programIdentifier ` | The program identifier for the program that should be recorded. |
  | ` shouldRecordSeries ` | Whether the whole series associated to the program should be recorded. |
  | ` data ` | Optional app-specific data. |

- `


  ### [recordProgramBatchable(programIdentifier:shouldRecordSeries:externalIDList:data:)](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait#/s:15GoogleHomeTypes6MatterO12ChannelTraitV22recordProgramBatchable17programIdentifier18shouldRecordSeries14externalIDList4data0aB3SDK0I7CommandVyytGSS_SbSayAE20AdditionalInfoStructVG10Foundation4DataVtKF)


  ` The batchable version of recordProgram command above.
  See also
  recordProgram

  #### Declaration

  Swift

      func recordProgramBatchable(programIdentifier: String, shouldRecordSeries: Bool, externalIDList: [https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter.html.ChannelTrait.https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait/AdditionalInfoStruct.html], data: Data) throws -> BatchableCommand<Void>

- `


  ### [supportsCancelRecordProgramCommand](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait#/s:15GoogleHomeTypes6MatterO12ChannelTraitV34supportsCancelRecordProgramCommandSbvp)


  ` Whether the device supports the `cancelRecordProgram` command for this trait.

  #### Declaration

  Swift

      var supportsCancelRecordProgramCommand: Bool { get }

- `


  ### [cancelRecordProgram(programIdentifier:shouldRecordSeries:externalIDList:data:)](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait#/s:15GoogleHomeTypes6MatterO12ChannelTraitV19cancelRecordProgram17programIdentifier06shouldH6Series14externalIDList4dataySS_SbSayAE20AdditionalInfoStructVG10Foundation4DataVtYaKF)


  ` Cancel recording for a specific program or series.

  #### Declaration

  Swift

      func cancelRecordProgram(programIdentifier: String, shouldRecordSeries: Bool, externalIDList: [https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter.html.ChannelTrait.https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait/AdditionalInfoStruct.html], data: Data) async throws

  #### Parameters

  |---|---|
  | ` programIdentifier ` | The program identifier for the program that should be cancelled from recording. |
  | ` shouldRecordSeries ` | Whether the whole series associated to the program should be cancelled from recording. |
  | ` data ` | Optional app-specific data. |

- `


  ### [cancelRecordProgramBatchable(programIdentifier:shouldRecordSeries:externalIDList:data:)](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait#/s:15GoogleHomeTypes6MatterO12ChannelTraitV28cancelRecordProgramBatchable17programIdentifier06shouldH6Series14externalIDList4data0aB3SDK0J7CommandVyytGSS_SbSayAE20AdditionalInfoStructVG10Foundation4DataVtKF)


  ` The batchable version of cancelRecordProgram command above.
  See also
  cancelRecordProgram

  #### Declaration

  Swift

      func cancelRecordProgramBatchable(programIdentifier: String, shouldRecordSeries: Bool, externalIDList: [https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter.html.ChannelTrait.https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait/AdditionalInfoStruct.html], data: Data) throws -> BatchableCommand<Void>

- `


  ### [ChannelTypeEnum](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait/ChannelTypeEnum.html)


  ` Types of channels.

  #### Declaration

  Swift

      enum ChannelTypeEnum

- `


  ### [LineupInfoTypeEnum](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait/LineupInfoTypeEnum.html)


  ` Types of lineup information.

  #### Declaration

  Swift

      enum LineupInfoTypeEnum

- `


  ### [StatusEnum](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait/StatusEnum.html)


  ` Statuses for channel selection commands.

  #### Declaration

  Swift

      enum StatusEnum

- `


  ### [Feature](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait/Feature.html)


  ` Channel cluster FeatureMap.

  #### Declaration

  Swift

      struct Feature

- `


  ### [RecordingFlagBitmap](https://developers.home.google.com/reference/swift/GoogleHomeTypes/Enums/Matter/ChannelTrait/RecordingFlagBitmap.html)


  ` Recording flags.

  #### Declaration

  Swift

      struct RecordingFlagBitmap