CHANGE: added publish topic functions

This commit is contained in:
2024-08-02 07:10:09 +02:00
parent e6a49d55e2
commit 942142f517
3 changed files with 37 additions and 26 deletions

View File

@@ -1,4 +1,4 @@
import { iMQTTEntityBase, MQTTEntity } from './mqtt_base';
import { MQTTEntity } from './mqtt_base';
export class MqttLight extends MQTTEntity {
pl_on: string = '1';
@@ -45,4 +45,12 @@ export class MqttLight extends MQTTEntity {
override get uniq_id() {
return this._uniq_id;
}
override publish_topics(index: number = 1): string[] {
return [
`String stat_topic_${index} = "${this.stat_t}";`,
`String cmd_topic_${index} = "${this.cmd_t}";`,
`String bri_cmd_topic_${index} = "${this.bri_cmd_t}";`,
];
}
}