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,3 @@
import { EntityService } from '../_services/entity.service';
import { DeviceClass, iMQTTEntityBase, MQTTEntity } from './mqtt_base';
export class MqttSwitch extends MQTTEntity {
@@ -41,6 +40,13 @@ export class MqttSwitch 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}";`,
];
}
}
export interface iMqttSwitch extends iMQTTEntityBase {