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

If this device is in a Room.

Boolean

If this device is in a Structure.

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

From com.google.home.automation.HasCandidates
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.

From com.google.home.HasDeviceTypes
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.

From com.google.home.HasTraits
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

From com.google.home.HasConnectivityState
SourceConnectivity

Source Connectivity for the device.

From com.google.home.HasId
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.