HomeDevice

interface HomeDevice : HasId, HasTraits, HasDeviceTypes, HasConnectivityState, HasCandidates


A device supporting traits, commands, and subscriptions.

Summary

Public functions

suspend Room?

Gets the up-to-date Room this device is a part of.

suspend Structure?

Gets the up-to-date Structure this device is a part of.

Public properties

Boolean

This property is deprecated. This member is deprecated please check for the presence of roomId instead.

Boolean

This property is deprecated. This member is deprecated please check for the presence of structureId instead.

Boolean

If this device is backed by Matter.

String

The user-given name of this device.

Id?

The ID of the Room this device is a part of.

Id?

The ID of the Structure this device is a part of.

Inherited functions

Flow<Set<NodeCandidate>>

Returns all the automation NodeCandidate instances for the receiver and its child objects.

Flow<Set<NodeCandidate>>

Returns all the automation NodeCandidate instances for the receiver.

Boolean
<T : DeviceType> has(type: DeviceTypeFactory<T>)

Checks if a device type is supported by this device.

Flow<T>
<T : DeviceType> type(type: DeviceTypeFactory<T>)

Gets a flow on the DeviceType using the given DeviceTypeFactory.

Flow<Set<DeviceType>>

Gets a list of all available types on the HomeDevice.

SourceConnectivity?

Gets metadata, such as network locality and connectivity state, about the source of data for a particular trait.

Boolean
<T : Trait> has(trait: TraitFactory<T>)

Checks if a trait is supported by a device.

Inherited properties

SourceConnectivity

Source Connectivity for the device.

Id

Opaque ID for the object.

Public functions

room

suspend fun room(): Room?

Gets the up-to-date Room this device is a part of.

Returns
Room?

the Room this device is a part of, or null if the device is not in a Room.

structure

suspend fun structure(): Structure?

Gets the up-to-date Structure this device is a part of.

Returns
Structure?

the Structure this device is a part of, or null if the device is not in a Structure.

Public properties

isInRoom

val isInRoomBoolean

If this device is in a Room.

isInStructure

val isInStructureBoolean

If this device is in a Structure.

isMatterDevice

val isMatterDeviceBoolean

If this device is backed by Matter.

name

val nameString

The user-given name of this device.

roomId

val roomIdId?

The ID of the Room this device is a part of. Null if the device is not in a Room.

structureId

val structureIdId?

The ID of the Structure this device is a part of. Null if the device is not in a Structure.