Discovery (#74)

* add support for Home Assistants MQTT discovery

* add format_topic a flexible separator

* add mqtt discovery for miflora

* add mqtt discovery for mithermometer

* add mqtt discovery for thermostat

* add unit to illuminance in miflora

* switch to 'away_mode_command_topic' instead of 'away_command_topic'

* revert changing the date format

* add mac to ientifiers and change the id generation

* add mac to ientifiers and change the id generation on thermostat

* add mac to ientifiers and change the id generation for mithermometer
This commit is contained in:
Marcel Hoppe
2019-06-21 12:25:27 +02:00
committed by zewelor
parent 01b30f6c4a
commit 8fbf3540bd
8 changed files with 192 additions and 35 deletions
+5 -2
View File
@@ -8,8 +8,11 @@ class BaseWorker:
def _setup(self):
return
def format_topic(self, *args):
return '/'.join([self.topic_prefix, *args])
def format_id(self, *args, separator='/'):
return separator.join(["bt-mqtt-gateway", repr(self), *args])
def format_topic(self, *args, separator='/'):
return separator.join([self.topic_prefix, *args])
def __repr__(self):
return self.__module__.split(".")[-1]