CHANGE: implemented DeviceClass
This commit is contained in:
@@ -1,7 +1,36 @@
|
||||
import { DEVICE_CLASS, MQTTEntity } from "./mqtt_base";
|
||||
import { DeviceClass, MQTTEntity } from './mqtt_base';
|
||||
|
||||
export class MqttBinary extends MQTTEntity {
|
||||
dev_cla: DEVICE_CLASS = 0
|
||||
pl_on: string = "1";
|
||||
pl_off: string = "0";
|
||||
dev_cla: DeviceClass = new DeviceClass([
|
||||
'battery',
|
||||
'battery_charging',
|
||||
'carbon_monoxide',
|
||||
'cold',
|
||||
'connectivity',
|
||||
'door',
|
||||
'garage_door',
|
||||
'gas',
|
||||
'heat',
|
||||
'light',
|
||||
'lock',
|
||||
'moisture',
|
||||
'motion',
|
||||
'moving',
|
||||
'occupancy',
|
||||
'opening',
|
||||
'plug',
|
||||
'power',
|
||||
'presence',
|
||||
'problem',
|
||||
'running',
|
||||
'safety',
|
||||
'smoke',
|
||||
'sound',
|
||||
'tamper',
|
||||
'update',
|
||||
'vibration',
|
||||
'window',
|
||||
]);
|
||||
pl_on: string = '1';
|
||||
pl_off: string = '0';
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { MQTTEntity } from "./mqtt_base";
|
||||
import { MQTTEntity } from './mqtt_base';
|
||||
|
||||
export class MqttLight extends MQTTEntity {
|
||||
cmd_t: string = "command/topic";
|
||||
bri_cmd_t: string = "brightness/command/topic";
|
||||
pl_on: string = "1";
|
||||
pl_off: string = "0";
|
||||
val_tpl: string = "";
|
||||
cmd_t: string = 'command/topic';
|
||||
bri_cmd_t: string = 'brightness/command/topic';
|
||||
pl_on: string = '1';
|
||||
pl_off: string = '0';
|
||||
val_tpl: string = '';
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { MQTTEntity } from "./mqtt_base";
|
||||
import { MQTTEntity } from './mqtt_base';
|
||||
|
||||
export class MqttSensor extends MQTTEntity {
|
||||
unit_of_meas: string = "meassure";
|
||||
}
|
||||
unit_of_meas: string = 'meassure';
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { DEVICE_CLASS, MQTTEntity } from "./mqtt_base";
|
||||
import { DeviceClass, MQTTEntity } from './mqtt_base';
|
||||
|
||||
export class MqttSwitch extends MQTTEntity {
|
||||
dev_cla: DEVICE_CLASS = 0
|
||||
cmd_t: string = "command/topic";
|
||||
pl_on: string = "1";
|
||||
pl_off: string = "0";
|
||||
dev_cla: DeviceClass = new DeviceClass(['switch', 'outlet']);
|
||||
cmd_t: string = 'command/topic';
|
||||
pl_on: string = '1';
|
||||
pl_off: string = '0';
|
||||
}
|
||||
Reference in New Issue
Block a user