make hass and entity conditional parameters
This commit is contained in:
parent
e687cf777d
commit
cac2f8ac06
10 changed files with 31 additions and 25 deletions
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue