From c2c82d73c1f0e8875b88dbc1a5ede882bea46f20 Mon Sep 17 00:00:00 2001 From: tom Date: Fri, 2 Aug 2024 08:11:08 +0200 Subject: [PATCH] CHANGE: removed some defaults in basemodel, to create less in toJSON --- src/app/_models/mqtt-light.ts | 4 ++-- src/app/_models/mqtt-sensor.ts | 2 +- src/app/_models/mqtt-switch.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/_models/mqtt-light.ts b/src/app/_models/mqtt-light.ts index dea55b3..1911d19 100644 --- a/src/app/_models/mqtt-light.ts +++ b/src/app/_models/mqtt-light.ts @@ -1,8 +1,8 @@ import { MQTTEntity } from './mqtt_base'; export class MqttLight extends MQTTEntity { - pl_on: string = '1'; - pl_off: string = '0'; + pl_on: string = ''; + pl_off: string = ''; val_tpl: string = ''; bri_cmd_t: string = 'brightness/command/topic'; _cmd_t: string = 'command/topic'; diff --git a/src/app/_models/mqtt-sensor.ts b/src/app/_models/mqtt-sensor.ts index bdc5080..da995ab 100644 --- a/src/app/_models/mqtt-sensor.ts +++ b/src/app/_models/mqtt-sensor.ts @@ -1,7 +1,7 @@ import { iMQTTEntityBase, MQTTEntity } from './mqtt_base'; export class MqttSensor extends MQTTEntity implements iMqttSensor { - unit_of_meas: string = 'meassure'; + unit_of_meas: string = ''; override ent_type: string = 'sensor'; override attrs: Set = new Set([ 'name', diff --git a/src/app/_models/mqtt-switch.ts b/src/app/_models/mqtt-switch.ts index 60eee29..fa90578 100644 --- a/src/app/_models/mqtt-switch.ts +++ b/src/app/_models/mqtt-switch.ts @@ -21,8 +21,8 @@ export class MqttSwitch extends MQTTEntity { _dev_cla: DeviceClass = new DeviceClass(['switch', 'outlet']); cmd_t: string = 'command/topic'; - pl_on: string = '1'; - pl_off: string = '0'; + pl_on: string = ''; + pl_off: string = ''; override set name(name: string) { super.name = name;