More minor fixes

This commit is contained in:
thomas committed 2019-01-02 11:14:18 +01:00
1 parent acabc57019
commit c0d9f01e29
3 files changed
+26 -18

No files matched your search

+4 -2
View File
@@ -104,10 +104,12 @@ class Entity:
class LightEntity(Entity):
def set_state(self, old, new):
if new == "on":
if new == "on" or new == True:
self._hass.call_service("light/turn_on", entity_id = self._entity)
elif new == "off":
self._state = "on"
elif new == "off" or new == False:
self._hass.call_service("light/turn_off", entity_id = self._entity)
self._state = "off"
class SwitchEntity(Entity):