Skip to content

Commit c54f2f0

Browse files
authored
fix: #173 include turn_off service and use the correct variable
1 parent 75b1660 commit c54f2f0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

custom_components/entity_controller/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1446,10 +1446,9 @@ def call_service(self, entity, service, **kwargs):
14461446
self.log.debug("call_service :: Setting ignore_state_changes_until to " + str(self.ignore_state_changes_until))
14471447

14481448
domain, e = entity.split(".")
1449-
if e == 'turn_on' and domain in homeassistant_turn_on_domains:
1449+
if service in ['turn_on','turn_off'] and domain in self.homeassistant_turn_on_domains:
14501450
domain = "homeassistant"
1451-
service = "homeassistant.turn_on"
1452-
self.log.debug("call_service :: Actualy calling service " + service + " on " + entity + " because the domain requires it.")
1451+
self.log.debug("call_service :: Actually calling service %s on %s via the %s domain because the entity domain requires it." % (service, entity, domain))
14531452
params = {}
14541453
if kwargs is not None:
14551454
params = kwargs

0 commit comments

Comments
 (0)