ThinkingHome.DeviceModel.FluentApi
ThinkingHome.DeviceModel.FluentApi
DeviceHandle Struct
Хендл устройства. Аксессоры способностей/свойств без указания endpoint'а — синонимы Endpoint(0) (0 — основной endpoint, как в ядре); никакого поиска «подходящего» endpoint'а нет. «Нет устройства» — исключение из ядра на рабочих вызовах, «нет способности» — данные (Unsupported / null).
public readonly struct DeviceHandleProperties
DeviceHandle.Id Property
Идентификатор устройства.
public string Id { get; }Property Value
Methods
DeviceHandle.AirQuality() Method
Индекс качества воздуха (endpoint 0).
public ThinkingHome.DeviceModel.FluentApi.Properties.AirQualityHandle AirQuality();Returns
DeviceHandle.Battery() Method
Уровень заряда батареи (endpoint 0).
public ThinkingHome.DeviceModel.FluentApi.Properties.BatteryHandle Battery();Returns
DeviceHandle.Brightness() Method
Яркость (endpoint 0).
public ThinkingHome.DeviceModel.FluentApi.Capabilities.BrightnessHandle Brightness();Returns
DeviceHandle.CarbonDioxide() Method
Концентрация CO2 (endpoint 0).
public ThinkingHome.DeviceModel.FluentApi.Properties.CarbonDioxideHandle CarbonDioxide();Returns
DeviceHandle.Color() Method
Цвет (endpoint 0).
public ThinkingHome.DeviceModel.FluentApi.Capabilities.ColorHandle Color();Returns
DeviceHandle.Contact() Method
Контакт датчика открытия (endpoint 0).
public ThinkingHome.DeviceModel.FluentApi.Properties.ContactHandle Contact();Returns
DeviceHandle.DescribeAsync(CancellationToken) Method
Discovery: описание устройства или null, если его нет.
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 — основной).
public ThinkingHome.DeviceModel.FluentApi.EndpointHandle Endpoint(int endpointId);Parameters
endpointId System.Int32
Returns
DeviceHandle.FanSpeed() Method
Скорость вентиляции (endpoint 0).
public ThinkingHome.DeviceModel.FluentApi.Capabilities.FanSpeedHandle FanSpeed();Returns
DeviceHandle.Humidity() Method
Влажность (endpoint 0).
public ThinkingHome.DeviceModel.FluentApi.Properties.HumidityHandle Humidity();Returns
DeviceHandle.Illuminance() Method
Освещённость (endpoint 0).
public ThinkingHome.DeviceModel.FluentApi.Properties.IlluminanceHandle Illuminance();Returns
DeviceHandle.Occupancy() Method
Присутствие/движение (endpoint 0).
public ThinkingHome.DeviceModel.FluentApi.Properties.OccupancyHandle Occupancy();Returns
DeviceHandle.OnChanged(Action<StateChange>) Method
Подписка на изменения этого устройства; отписка — Dispose.
public System.IDisposable OnChanged(System.Action<ThinkingHome.DeviceModel.State.StateChange> handler);Parameters
handler System.Action<StateChange>
Returns
DeviceHandle.OnOff() Method
Вкл/выкл (endpoint 0).
public ThinkingHome.DeviceModel.FluentApi.Capabilities.OnOffHandle OnOff();Returns
DeviceHandle.Open() Method
Степень открытия (endpoint 0).
public ThinkingHome.DeviceModel.FluentApi.Capabilities.OpenHandle Open();Returns
DeviceHandle.Oscillation() Method
Осцилляция (endpoint 0).
public ThinkingHome.DeviceModel.FluentApi.Capabilities.OscillationHandle Oscillation();Returns
DeviceHandle.Pressure() Method
Атмосферное давление (endpoint 0).
public ThinkingHome.DeviceModel.FluentApi.Properties.PressureHandle Pressure();Returns
DeviceHandle.QueryAsync(CancellationToken) Method
Полный снапшот состояния — как QueryAsync(string, CancellationToken) ядра.
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).
public ThinkingHome.DeviceModel.FluentApi.Capabilities.TargetTemperatureHandle TargetTemperature();Returns
DeviceHandle.Temperature() Method
Температура (endpoint 0).
public ThinkingHome.DeviceModel.FluentApi.Properties.TemperatureHandle Temperature();Returns
DeviceHandle.ThermostatMode() Method
Режим термостата (endpoint 0).
public ThinkingHome.DeviceModel.FluentApi.Capabilities.ThermostatModeHandle ThermostatMode();Returns
DeviceHandle.WaterLeak() Method
Протечка воды (endpoint 0).
public ThinkingHome.DeviceModel.FluentApi.Properties.WaterLeakHandle WaterLeak();Returns
DeviceHandle.WaterMeter() Method
Показания счётчика воды (endpoint 0).
public ThinkingHome.DeviceModel.FluentApi.Properties.WaterMeterHandle WaterMeter();