Skip to content

Commit

Permalink
rename data var
Browse files Browse the repository at this point in the history
  • Loading branch information
xiki808 committed Sep 28, 2021
1 parent a86d5c6 commit 715bc81
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,21 +228,21 @@ def _handle_light_color(self, message):
voc_match = entity

if self.voc_match(voc_match, "all_lights"):
data_obj = {'entity_id': 'all'}
action_data = {'entity_id': 'all'}
ha_entity = {'dev_name': 'all lights'}
else:
ha_entity = self._find_entity(entity, ['group', 'light'])

if not ha_entity or not self._check_availability(ha_entity):
return

data_obj = {'entity_id': ha_entity['id']}
action_data = {'entity_id': ha_entity['id']}

data_obj['color_name'] = message.data['color']
self.ha.execute_service("light", "turn_on", data_obj)
action_data['color_name'] = message.data['color']
self.ha.execute_service("light", "turn_on", action_data)

data_obj['dev_name'] = ha_entity['dev_name']
self.speak_dialog('homeassistant.color.change', data=data_obj)
action_data['dev_name'] = ha_entity['dev_name']
self.speak_dialog('homeassistant.color.change', data=action_data)

@intent_handler('automation.intent')
def handle_automation_intent(self, message):
Expand Down

0 comments on commit 715bc81

Please sign in to comment.