Revised entity toggle to use is_on

The toggle function in the Entity ABC was using state == STATE_ON to
determine whether the entity was on. This was revised to use the is_on
property instead.
This commit is contained in:
Ryan Kraus 2016-01-17 16:59:22 -05:00
parent 0624445627
commit 85aa4fdd2e

View File

@ -177,7 +177,7 @@ class ToggleEntity(Entity):
def toggle(self, **kwargs):
""" Toggle the entity off. """
if self.state == STATE_ON:
if self.is_on:
self.turn_off(**kwargs)
else:
self.turn_on(**kwargs)