From 0977be1842be1358c8687fd213584da6ad2c53a5 Mon Sep 17 00:00:00 2001 From: Sergio Viudes <sjvc@users.noreply.github.com> Date: Tue, 20 Mar 2018 08:43:31 +0100 Subject: [PATCH] Added switch for DoorBird second relay (#13339) --- homeassistant/components/doorbird.py | 2 +- homeassistant/components/switch/doorbird.py | 10 ++++++++++ requirements_all.txt | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/doorbird.py b/homeassistant/components/doorbird.py index be7adc034a0..34758023f60 100644 --- a/homeassistant/components/doorbird.py +++ b/homeassistant/components/doorbird.py @@ -13,7 +13,7 @@ from homeassistant.const import CONF_HOST, CONF_USERNAME, CONF_PASSWORD from homeassistant.components.http import HomeAssistantView import homeassistant.helpers.config_validation as cv -REQUIREMENTS = ['DoorBirdPy==0.1.2'] +REQUIREMENTS = ['DoorBirdPy==0.1.3'] _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/switch/doorbird.py b/homeassistant/components/switch/doorbird.py index 4ab8eea6ec4..9886b3a586d 100644 --- a/homeassistant/components/switch/doorbird.py +++ b/homeassistant/components/switch/doorbird.py @@ -22,6 +22,14 @@ SWITCHES = { }, "time": datetime.timedelta(seconds=3) }, + "open_door_2": { + "name": "Open Door 2", + "icon": { + True: "lock-open", + False: "lock" + }, + "time": datetime.timedelta(seconds=3) + }, "light_on": { "name": "Light On", "icon": { @@ -80,6 +88,8 @@ class DoorBirdSwitch(SwitchDevice): """Power the relay.""" if self._switch == "open_door": self._state = self._device.open_door() + elif self._switch == "open_door_2": + self._state = self._device.open_door(2) elif self._switch == "light_on": self._state = self._device.turn_light_on() diff --git a/requirements_all.txt b/requirements_all.txt index 91173a1825c..e2696bdd934 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -19,7 +19,7 @@ attrs==17.4.0 # Adafruit_BBIO==1.0.0 # homeassistant.components.doorbird -DoorBirdPy==0.1.2 +DoorBirdPy==0.1.3 # homeassistant.components.homekit HAP-python==1.1.7 -- GitLab