TogglesTrait.Toggle

class TogglesTrait.Toggle : ClusterStruct


A toggle that is available on the device.

Summary

Nested types

Descriptor enum for this struct's fields.

Public constructors

Creates the Toggle class.

Public functions

open StructDescriptor

Returns the descriptor for the struct.

open Any?

Returns the value of the field for the given tag ID.

Public properties

String

Internal name of the toggle, which will be used in commands and states.

List<TogglesTrait.ToggleSynonyms>

Synonyms of the toggle in each supported language.

Public constructors

Toggle

Toggle(
    name: String = "",
    synonyms: List<TogglesTrait.ToggleSynonyms> = emptyList()
)

Creates the Toggle class.

Public functions

getDescriptor

@HomeExperimentalApi
open fun getDescriptor(): StructDescriptor

Returns the descriptor for the struct.

getFieldValueById

@HomeExperimentalApi
open fun getFieldValueById(tagId: UInt): Any?

Returns the value of the field for the given tag ID.

Public properties

name

val nameString

Internal name of the toggle, which will be used in commands and states. This can be non-user-friendly, and will be shared across all languages.

synonyms

val synonymsList<TogglesTrait.ToggleSynonyms>

Synonyms of the toggle in each supported language.