Skip to content

Commit

Permalink
Update follow_me.py
Browse files Browse the repository at this point in the history
Fix break when invert == True
  • Loading branch information
aneisch authored Dec 10, 2021
1 parent edd8f7a commit 9799b3d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/follow_me/follow_me.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def state_change(self, entity, attribute, old, new, kwargs):
for device in self.split_device_list(self.args["follower"]):
if self.invert:
self.log(f"Turning off {device}{f' in {self.delay} seconds' if self.delay > 0 else ''}")
self.run_in(self.turn_off(device), self.delay)
self.run_in(self.turn_off_handler, self.delay, entity_id=device)
else:
self.log(f"Turning on {device}{f' in {self.delay} seconds' if self.delay > 0 else ''}")
self.run_in(self.turn_on_handler, self.delay, entity_id=device)
Expand All @@ -51,7 +51,7 @@ def state_change(self, entity, attribute, old, new, kwargs):
for device in self.split_device_list(self.args["follower"]):
if self.invert:
self.log(f"Turning on {device}{f' in {self.delay} seconds' if self.delay > 0 else ''}")
self.run_in(self.turn_on(device), self.delay)
self.run_in(self.turn_on_handler, self.delay, entity_id=device)
else:
self.log(f"Turning off {device}{f' in {self.delay} seconds' if self.delay > 0 else ''}")
self.run_in(self.turn_off_handler, self.delay, entity_id=device)

0 comments on commit 9799b3d

Please sign in to comment.