EmptyPartsProvider

@HomeExperimentalApi
object EmptyPartsProvider : PartsProvider


A PartsProvider for objects that expose no parts.

Summary

Public functions

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

Gets a flow on the DeviceType using the given DeviceTypeFactory and Tag.

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

Gets a flow on the DeviceType using the given DeviceTypeFactory and Tag.

open Flow<Set<DeviceType>>

Gets a flow on the DeviceTypes that are parts of this object.

open String

Public properties

open SourceConnectivity

Source Connectivity for the device.

Public functions

part

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

Gets a flow on the DeviceType using the given DeviceTypeFactory and Tag.

Parameters
type: DeviceTypeFactory<T>

the device type to get.

vararg tags: Tag

The tags to filter by.

Returns
Flow<T>

a flow that can be used to track changes to a specific type. If the type is not supported, an empty flow is returned. When multiple instances match, whether the first match or nothing is emitted depends on the implementation; pass tags to disambiguate.

partOrNull

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

Gets a flow on the DeviceType using the given DeviceTypeFactory and Tag.

Parameters
type: DeviceTypeFactory<T>

the device type to get.

vararg tags: Tag

The tags to filter by.

Returns
Flow<T?>

a flow that can be used to track changes to a specific type. If the type is not supported, null is emitted. When multiple instances match, whether the first match or null is emitted depends on the implementation; pass tags to disambiguate.

parts

open fun parts(): Flow<Set<DeviceType>>

Gets a flow on the DeviceTypes that are parts of this object.

Returns
Flow<Set<DeviceType>>

a flow that can be used to track changes to the parts of this object.

toString

open fun toString(): String

Public properties

sourceConnectivity

open val sourceConnectivity: SourceConnectivity

Source Connectivity for the device.