From be9a2a043ec0313971c5d52d3e1945c6cbaa1c53 Mon Sep 17 00:00:00 2001 From: Eric Rolf Date: Thu, 11 Feb 2016 09:57:56 -0500 Subject: [PATCH] Refactored Method Names. --- homeassistant/components/garage_door/__init__.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/garage_door/__init__.py b/homeassistant/components/garage_door/__init__.py index 2dc77885294..835aa36cc62 100644 --- a/homeassistant/components/garage_door/__init__.py +++ b/homeassistant/components/garage_door/__init__.py @@ -34,19 +34,20 @@ DISCOVERY_PLATFORMS = { _LOGGER = logging.getLogger(__name__) + def is_closed(hass, entity_id=None): """ Returns if the garage door is closed based on the statemachine. """ entity_id = entity_id or ENTITY_ID_ALL_GARAGE_DOORS return hass.states.is_state(entity_id, STATE_CLOSED) -def close(hass, entity_id=None): +def close_door(hass, entity_id=None): """ Closes all or specified garage door. """ data = {ATTR_ENTITY_ID: entity_id} if entity_id else None hass.services.call(DOMAIN, SERVICE_CLOSE, data) -def open(hass, entity_id=None): +def open_door(hass, entity_id=None): """ Open all or specified garage door. """ data = {ATTR_ENTITY_ID: entity_id} if entity_id else None hass.services.call(DOMAIN, SERVICE_OPEN, data) @@ -65,9 +66,9 @@ def setup(hass, config): for item in target_locks: if service.service == SERVICE_CLOSE: - item.close() + item.close_door() else: - item.open() + item.open_door() if item.should_poll: item.update_ha_state(True)