mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 09:47:13 +00:00
Add Tado set presence (#32765)
* Updated tado integration climate.py to allow for presence change * Updated tado integration __init__.py to allow for presence change * Black formatting * Added missing docstring * Added missing period to docstring * Using constants from climate component * Filter out other preset_modes * Linting error fix * Isort error fix * Filtering of unwanted presence mode in init * Bumped python-tado version to 0.5.0 Removed unnecessary preset mode check * Update requirements_all.txt
This commit is contained in:
parent
df67ab995f
commit
c8d4cf08d9
@ -6,6 +6,7 @@ import urllib
|
||||
from PyTado.interface import Tado
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.climate.const import PRESET_AWAY, PRESET_HOME
|
||||
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
|
||||
from homeassistant.helpers import config_validation as cv
|
||||
from homeassistant.helpers.discovery import load_platform
|
||||
@ -162,6 +163,15 @@ class TadoConnector:
|
||||
self.tado.resetZoneOverlay(zone_id)
|
||||
self.update_sensor("zone", zone_id)
|
||||
|
||||
def set_presence(
|
||||
self, presence=PRESET_HOME,
|
||||
):
|
||||
"""Set the presence to home or away."""
|
||||
if presence == PRESET_AWAY:
|
||||
self.tado.setAway()
|
||||
elif presence == PRESET_HOME:
|
||||
self.tado.setHome()
|
||||
|
||||
def set_zone_overlay(
|
||||
self,
|
||||
zone_id,
|
||||
|
@ -289,7 +289,7 @@ class TadoClimate(ClimateDevice):
|
||||
|
||||
def set_preset_mode(self, preset_mode):
|
||||
"""Set new preset mode."""
|
||||
pass
|
||||
self._tado.set_presence(preset_mode)
|
||||
|
||||
@property
|
||||
def temperature_unit(self):
|
||||
|
@ -3,7 +3,7 @@
|
||||
"name": "Tado",
|
||||
"documentation": "https://www.home-assistant.io/integrations/tado",
|
||||
"requirements": [
|
||||
"python-tado==0.3.0"
|
||||
"python-tado==0.5.0"
|
||||
],
|
||||
"dependencies": [],
|
||||
"codeowners": [
|
||||
|
@ -1658,7 +1658,7 @@ python-songpal==0.11.2
|
||||
python-synology==0.4.0
|
||||
|
||||
# homeassistant.components.tado
|
||||
python-tado==0.3.0
|
||||
python-tado==0.5.0
|
||||
|
||||
# homeassistant.components.telegram_bot
|
||||
python-telegram-bot==11.1.0
|
||||
|
Loading…
x
Reference in New Issue
Block a user