Skip to content

ThinkingHome.DeviceModel.FluentApi

ThinkingHome.DeviceModel.FluentApi

DeviceHandle Struct

Хендл устройства. Аксессоры способностей/свойств без указания endpoint'а — синонимы Endpoint(0) (0 — основной endpoint, как в ядре); никакого поиска «подходящего» endpoint'а нет. «Нет устройства» — исключение из ядра на рабочих вызовах, «нет способности» — данные (Unsupported / null).

csharp
public readonly struct DeviceHandle

Properties

DeviceHandle.Id Property

Идентификатор устройства.

csharp
public string Id { get; }

Property Value

System.String

Methods

DeviceHandle.AirQuality() Method

Индекс качества воздуха (endpoint 0).

csharp
public ThinkingHome.DeviceModel.FluentApi.Properties.AirQualityHandle AirQuality();

Returns

AirQualityHandle

DeviceHandle.Battery() Method

Уровень заряда батареи (endpoint 0).

csharp
public ThinkingHome.DeviceModel.FluentApi.Properties.BatteryHandle Battery();

Returns

BatteryHandle

DeviceHandle.Brightness() Method

Яркость (endpoint 0).

csharp
public ThinkingHome.DeviceModel.FluentApi.Capabilities.BrightnessHandle Brightness();

Returns

BrightnessHandle

DeviceHandle.CarbonDioxide() Method

Концентрация CO2 (endpoint 0).

csharp
public ThinkingHome.DeviceModel.FluentApi.Properties.CarbonDioxideHandle CarbonDioxide();

Returns

CarbonDioxideHandle

DeviceHandle.Color() Method

Цвет (endpoint 0).

csharp
public ThinkingHome.DeviceModel.FluentApi.Capabilities.ColorHandle Color();

Returns

ColorHandle

DeviceHandle.Contact() Method

Контакт датчика открытия (endpoint 0).

csharp
public ThinkingHome.DeviceModel.FluentApi.Properties.ContactHandle Contact();

Returns

ContactHandle

DeviceHandle.DescribeAsync(CancellationToken) Method

Discovery: описание устройства или null, если его нет.

csharp
public System.Threading.Tasks.Task<ThinkingHome.DeviceModel.DeviceDescriptor?> DescribeAsync(System.Threading.CancellationToken ct=default(System.Threading.CancellationToken));

Parameters

ct System.Threading.CancellationToken

Returns

System.Threading.Tasks.Task<DeviceDescriptor>

DeviceHandle.Endpoint(int) Method

Хендл endpoint'а (0 — основной).

csharp
public ThinkingHome.DeviceModel.FluentApi.EndpointHandle Endpoint(int endpointId);

Parameters

endpointId System.Int32

Returns

EndpointHandle

DeviceHandle.FanSpeed() Method

Скорость вентиляции (endpoint 0).

csharp
public ThinkingHome.DeviceModel.FluentApi.Capabilities.FanSpeedHandle FanSpeed();

Returns

FanSpeedHandle

DeviceHandle.Humidity() Method

Влажность (endpoint 0).

csharp
public ThinkingHome.DeviceModel.FluentApi.Properties.HumidityHandle Humidity();

Returns

HumidityHandle

DeviceHandle.Illuminance() Method

Освещённость (endpoint 0).

csharp
public ThinkingHome.DeviceModel.FluentApi.Properties.IlluminanceHandle Illuminance();

Returns

IlluminanceHandle

DeviceHandle.Occupancy() Method

Присутствие/движение (endpoint 0).

csharp
public ThinkingHome.DeviceModel.FluentApi.Properties.OccupancyHandle Occupancy();

Returns

OccupancyHandle

DeviceHandle.OnChanged(Action<StateChange>) Method

Подписка на изменения этого устройства; отписка — Dispose.

csharp
public System.IDisposable OnChanged(System.Action<ThinkingHome.DeviceModel.State.StateChange> handler);

Parameters

handler System.Action<StateChange>

Returns

System.IDisposable

DeviceHandle.OnOff() Method

Вкл/выкл (endpoint 0).

csharp
public ThinkingHome.DeviceModel.FluentApi.Capabilities.OnOffHandle OnOff();

Returns

OnOffHandle

DeviceHandle.Open() Method

Степень открытия (endpoint 0).

csharp
public ThinkingHome.DeviceModel.FluentApi.Capabilities.OpenHandle Open();

Returns

OpenHandle

DeviceHandle.Oscillation() Method

Осцилляция (endpoint 0).

csharp
public ThinkingHome.DeviceModel.FluentApi.Capabilities.OscillationHandle Oscillation();

Returns

OscillationHandle

DeviceHandle.Pressure() Method

Атмосферное давление (endpoint 0).

csharp
public ThinkingHome.DeviceModel.FluentApi.Properties.PressureHandle Pressure();

Returns

PressureHandle

DeviceHandle.QueryAsync(CancellationToken) Method

Полный снапшот состояния — как QueryAsync(string, CancellationToken) ядра.

csharp
public System.Threading.Tasks.Task<ThinkingHome.DeviceModel.State.DeviceSnapshot> QueryAsync(System.Threading.CancellationToken ct=default(System.Threading.CancellationToken));

Parameters

ct System.Threading.CancellationToken

Returns

System.Threading.Tasks.Task<DeviceSnapshot>

DeviceHandle.TargetTemperature() Method

Целевая температура (endpoint 0).

csharp
public ThinkingHome.DeviceModel.FluentApi.Capabilities.TargetTemperatureHandle TargetTemperature();

Returns

TargetTemperatureHandle

DeviceHandle.Temperature() Method

Температура (endpoint 0).

csharp
public ThinkingHome.DeviceModel.FluentApi.Properties.TemperatureHandle Temperature();

Returns

TemperatureHandle

DeviceHandle.ThermostatMode() Method

Режим термостата (endpoint 0).

csharp
public ThinkingHome.DeviceModel.FluentApi.Capabilities.ThermostatModeHandle ThermostatMode();

Returns

ThermostatModeHandle

DeviceHandle.WaterLeak() Method

Протечка воды (endpoint 0).

csharp
public ThinkingHome.DeviceModel.FluentApi.Properties.WaterLeakHandle WaterLeak();

Returns

WaterLeakHandle

DeviceHandle.WaterMeter() Method

Показания счётчика воды (endpoint 0).

csharp
public ThinkingHome.DeviceModel.FluentApi.Properties.WaterMeterHandle WaterMeter();

Returns

WaterMeterHandle

Опубликовано под лицензией MIT