From 24060e0fb55facede6c040c70b59281d40b5fe0b Mon Sep 17 00:00:00 2001 From: Jonas Pedersen Date: Tue, 30 Apr 2019 23:07:49 +0200 Subject: [PATCH] Add bypass and automatic bypass switch for Danfor Air. (#23572) Add bypass and automatic bypass switch for Danfoss Air --- homeassistant/components/danfoss_air/__init__.py | 4 ++++ homeassistant/components/danfoss_air/manifest.json | 2 +- homeassistant/components/danfoss_air/switch.py | 10 +++++++++- requirements_all.txt | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/danfoss_air/__init__.py b/homeassistant/components/danfoss_air/__init__.py index a340b94e9a4..6e86b16c02d 100644 --- a/homeassistant/components/danfoss_air/__init__.py +++ b/homeassistant/components/danfoss_air/__init__.py @@ -85,5 +85,9 @@ class DanfossAir: = self._client.command(ReadCommand.boost) self._data[ReadCommand.battery_percent] \ = self._client.command(ReadCommand.battery_percent) + self._data[ReadCommand.bypass] \ + = self._client.command(ReadCommand.bypass) + self._data[ReadCommand.automatic_bypass] \ + = self._client.command(ReadCommand.automatic_bypass) _LOGGER.debug("Done fetching data from Danfoss Air CCM module") diff --git a/homeassistant/components/danfoss_air/manifest.json b/homeassistant/components/danfoss_air/manifest.json index 8af1707de65..a210b5a78d1 100644 --- a/homeassistant/components/danfoss_air/manifest.json +++ b/homeassistant/components/danfoss_air/manifest.json @@ -3,7 +3,7 @@ "name": "Danfoss air", "documentation": "https://www.home-assistant.io/components/danfoss_air", "requirements": [ - "pydanfossair==0.0.7" + "pydanfossair==0.1.0" ], "dependencies": [], "codeowners": [] diff --git a/homeassistant/components/danfoss_air/switch.py b/homeassistant/components/danfoss_air/switch.py index f5a7fd47f69..4e7fce28dc7 100644 --- a/homeassistant/components/danfoss_air/switch.py +++ b/homeassistant/components/danfoss_air/switch.py @@ -19,6 +19,14 @@ def setup_platform(hass, config, add_entities, discovery_info=None): ReadCommand.boost, UpdateCommand.boost_activate, UpdateCommand.boost_deactivate], + ["Danfoss Air Bypass", + ReadCommand.bypass, + UpdateCommand.bypass_activate, + UpdateCommand.bypass_deactivate], + ["Danfoss Air Automatic Bypass", + ReadCommand.automatic_bypass, + UpdateCommand.bypass_activate, + UpdateCommand.bypass_deactivate], ] dev = [] @@ -59,7 +67,7 @@ class DanfossAir(SwitchDevice): def turn_off(self, **kwargs): """Turn the switch off.""" - _LOGGER.debug("Turning of switch with command %s", self._off_command) + _LOGGER.debug("Turning off switch with command %s", self._off_command) self._data.update_state(self._off_command, self._state_command) def update(self): diff --git a/requirements_all.txt b/requirements_all.txt index 35bf6eac815..b4f78ab24da 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1009,7 +1009,7 @@ pycsspeechtts==1.0.2 pydaikin==1.4.0 # homeassistant.components.danfoss_air -pydanfossair==0.0.7 +pydanfossair==0.1.0 # homeassistant.components.deconz pydeconz==55