GenericPartsProvider

@HomeExperimentalGenericApi
class GenericPartsProvider : HasParts


Summary

Public constructors

Public functions

open T
<T : DeviceType> part(type: DeviceTypeFactory<T>, vararg tags: Tag)

Returns the first part that matches the given type and tags.

open T?
<T : DeviceType> partOrNull(type: DeviceTypeFactory<T>, vararg tags: Tag)

Returns the first part that matches the given type and tags.

Public properties

open Set<DeviceType>

The parts of this object represented as a set of device types.

Public constructors

GenericPartsProvider

GenericPartsProvider()

Public functions

part

open fun <T : DeviceType> part(type: DeviceTypeFactory<T>, vararg tags: Tag): T

Returns the first part that matches the given type and tags. If no part matches, this method will throw a HomeException. If there are multiple parts that match, this method will throw a HomeException with error code HomeException.Codes.INVALID_ARGUMENT.

partOrNull

open fun <T : DeviceType> partOrNull(type: DeviceTypeFactory<T>, vararg tags: Tag): T?

Returns the first part that matches the given type and tags. If no part matches, this method will return null.

Public properties

parts

open val partsSet<DeviceType>

The parts of this object represented as a set of device types.