make hass and entity conditional parameters

This commit is contained in:
jbouwh 2021-12-21 11:18:51 +00:00
parent e687cf777d
commit cac2f8ac06
10 changed files with 31 additions and 25 deletions

View file

@ -330,7 +330,9 @@ class MqttLight(MqttEntity, LightEntity, RestoreEntity):
for key in COMMAND_TEMPLATE_KEYS:
command_templates[key] = None
for key in COMMAND_TEMPLATE_KEYS & config.keys():
command_templates[key] = MqttCommandTemplate(config[key], self).async_render
command_templates[key] = MqttCommandTemplate(
config[key], entity=self
).async_render
self._command_templates = command_templates
optimistic = config[CONF_OPTIMISTIC]