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:
+5
-2
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user