Moved more methods out of HomeAssistant object
This commit is contained in:
1 parent
c08676aa81
commit
5835d502c7
13 files changed
+149
-111
No files matched your search
@@ -43,14 +43,14 @@ def turn_on(hass, entity_id=None):
|
||||
""" Turns all or specified switch on. """
|
||||
data = {ATTR_ENTITY_ID: entity_id} if entity_id else None
|
||||
|
||||
hass.call_service(DOMAIN, SERVICE_TURN_ON, data)
|
||||
hass.services.call(DOMAIN, SERVICE_TURN_ON, data)
|
||||
|
||||
|
||||
def turn_off(hass, entity_id=None):
|
||||
""" Turns all or specified switch off. """
|
||||
data = {ATTR_ENTITY_ID: entity_id} if entity_id else None
|
||||
|
||||
hass.call_service(DOMAIN, SERVICE_TURN_OFF, data)
|
||||
hass.services.call(DOMAIN, SERVICE_TURN_OFF, data)
|
||||
|
||||
|
||||
# pylint: disable=too-many-branches
|
||||
|
||||
Reference in new issue
Block a user