getIotDevices

abstract fun getIotDevices(sorting: Sorting, iotDeviceFilter: IotDeviceFilter? = null, propertyFilter: PropertyFilter? = null, updateIntervalMillis: Long = -1): Flow<Result<List<IotDevice>>>

Get a Flow with Result containing a list of IotDevice.

Since

1.3.0

Return

Flow with Result containing list of IotDevice.

Parameters

sorting

Order of the returned IotDevice. Sorting.None, will be the same returned by backend and Sorting.Distance will use bluetooth scan to order from nearest to out-of-range.

iotDeviceFilter

IotDeviceFilter(s) to be applied to the iotDevices. There are a few pre-defined filters such as NearbyFilter and IotDeviceFilterList. Applications can define their own filter(s) and use IotDeviceFilterList to combine different filtering. The advantage of using a filter through this method (instead of simply using a Transformations.map(LiveData)), is that those filters are processed on a background thread, and results are made distinct.

propertyFilter

PropertyFilter(s) to be applied to the iotDevices. When filtered out, properties will be removed from the IotDevice object. IotDevice objects without any property will be removed from the list. There are a few pre-defined filters such as WritablePropertyFilter, PropertyKindFilter and AvailablePropertyFilter. Applications can define their own filter(s) and use PropertyFilterList to combine different filtering. The advantage of using a filter through this method (instead of simply using a Transformations.map(LiveData)), is that those filters are processed on a background thread, and results are made distinct.

updateIntervalMillis

The update interval in milliseconds, if its zero or less the query will execute only once.

abstract fun getIotDevices(iotDeviceFilter: IotDeviceFilter? = null, propertyFilter: PropertyFilter? = null, updateIntervalMillis: Long = -1): Flow<Result<List<IotDevice>>>

Get a Flow with Result containing a list of IotDevice.

Since

1.6.0

Return

Flow with Result containing list of IotDevice.

Parameters

iotDeviceFilter

IotDeviceFilter(s) to be applied to the iotDevices. There are a few pre-defined filters such as NearbyFilter and IotDeviceFilterList. Applications can define their own filter(s) and use IotDeviceFilterList to combine different filtering. The advantage of using a filter through this method (instead of simply using a Transformations.map(LiveData)), is that those filters are processed on a background thread, and results are made distinct.

propertyFilter

PropertyFilter(s) to be applied to the iotDevices. When filtered out, properties will be removed from the IotDevice object. IotDevice objects without any property will be removed from the list. There are a few pre-defined filters such as WritablePropertyFilter, PropertyKindFilter and AvailablePropertyFilter. Applications can define their own filter(s) and use PropertyFilterList to combine different filtering. The advantage of using a filter through this method (instead of simply using a Transformations.map(LiveData)), is that those filters are processed on a background thread, and results are made distinct.

updateIntervalMillis

The update interval in milliseconds, if its zero or less the query will execute only once.