mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 10:17:09 +00:00
Allow on/off on tado climate component. (#22242)
* Allow on/off on tado climate component. Bump python-tado version. Patch from @wmalgadey * Revert wrongly change in tado device tracker
This commit is contained in:
parent
56cbe8a73f
commit
b2bb70b5aa
@ -10,7 +10,7 @@ from homeassistant.helpers import config_validation as cv
|
|||||||
from homeassistant.const import CONF_USERNAME, CONF_PASSWORD
|
from homeassistant.const import CONF_USERNAME, CONF_PASSWORD
|
||||||
from homeassistant.util import Throttle
|
from homeassistant.util import Throttle
|
||||||
|
|
||||||
REQUIREMENTS = ['python-tado==0.2.8']
|
REQUIREMENTS = ['python-tado==0.2.9']
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -4,9 +4,10 @@ import logging
|
|||||||
from homeassistant.const import (PRECISION_TENTHS, TEMP_CELSIUS)
|
from homeassistant.const import (PRECISION_TENTHS, TEMP_CELSIUS)
|
||||||
from homeassistant.components.climate import ClimateDevice
|
from homeassistant.components.climate import ClimateDevice
|
||||||
from homeassistant.components.climate.const import (
|
from homeassistant.components.climate.const import (
|
||||||
SUPPORT_TARGET_TEMPERATURE, SUPPORT_OPERATION_MODE)
|
SUPPORT_TARGET_TEMPERATURE, SUPPORT_OPERATION_MODE, SUPPORT_ON_OFF)
|
||||||
|
from homeassistant.const import (
|
||||||
|
ATTR_TEMPERATURE, PRECISION_TENTHS, TEMP_CELSIUS)
|
||||||
from homeassistant.util.temperature import convert as convert_temperature
|
from homeassistant.util.temperature import convert as convert_temperature
|
||||||
from homeassistant.const import ATTR_TEMPERATURE
|
|
||||||
from homeassistant.components.tado import DATA_TADO
|
from homeassistant.components.tado import DATA_TADO
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
@ -41,7 +42,8 @@ OPERATION_LIST = {
|
|||||||
CONST_MODE_OFF: 'Off',
|
CONST_MODE_OFF: 'Off',
|
||||||
}
|
}
|
||||||
|
|
||||||
SUPPORT_FLAGS = SUPPORT_TARGET_TEMPERATURE | SUPPORT_OPERATION_MODE
|
SUPPORT_FLAGS = (SUPPORT_TARGET_TEMPERATURE | SUPPORT_OPERATION_MODE |
|
||||||
|
SUPPORT_ON_OFF)
|
||||||
|
|
||||||
|
|
||||||
def setup_platform(hass, config, add_entities, discovery_info=None):
|
def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||||
@ -199,6 +201,27 @@ class TadoClimate(ClimateDevice):
|
|||||||
"""Return the temperature we try to reach."""
|
"""Return the temperature we try to reach."""
|
||||||
return self._target_temp
|
return self._target_temp
|
||||||
|
|
||||||
|
@property
|
||||||
|
def is_on(self):
|
||||||
|
"""Return true if heater is on."""
|
||||||
|
return self._device_is_active
|
||||||
|
|
||||||
|
def turn_off(self):
|
||||||
|
"""Turn device off."""
|
||||||
|
_LOGGER.info("Switching mytado.com to OFF for zone %s",
|
||||||
|
self.zone_name)
|
||||||
|
|
||||||
|
self._current_operation = CONST_MODE_OFF
|
||||||
|
self._control_heating()
|
||||||
|
|
||||||
|
def turn_on(self):
|
||||||
|
"""Turn device on."""
|
||||||
|
_LOGGER.info("Switching mytado.com to %s mode for zone %s",
|
||||||
|
self._overlay_mode, self.zone_name)
|
||||||
|
|
||||||
|
self._current_operation = self._overlay_mode
|
||||||
|
self._control_heating()
|
||||||
|
|
||||||
def set_temperature(self, **kwargs):
|
def set_temperature(self, **kwargs):
|
||||||
"""Set new target temperature."""
|
"""Set new target temperature."""
|
||||||
temperature = kwargs.get(ATTR_TEMPERATURE)
|
temperature = kwargs.get(ATTR_TEMPERATURE)
|
||||||
|
@ -52,9 +52,9 @@ class TadoDeviceScanner(DeviceScanner):
|
|||||||
|
|
||||||
# If there's a home_id, we need a different API URL
|
# If there's a home_id, we need a different API URL
|
||||||
if self.home_id is None:
|
if self.home_id is None:
|
||||||
self.tadoapiurl = 'https://auth.tado.com/api/v2/me'
|
self.tadoapiurl = 'https://my.tado.com/api/v2/me'
|
||||||
else:
|
else:
|
||||||
self.tadoapiurl = 'https://auth.tado.com/api/v2' \
|
self.tadoapiurl = 'https://my.tado.com/api/v2' \
|
||||||
'/homes/{home_id}/mobileDevices'
|
'/homes/{home_id}/mobileDevices'
|
||||||
|
|
||||||
# The API URL always needs a username and password
|
# The API URL always needs a username and password
|
||||||
|
@ -1394,7 +1394,7 @@ python-songpal==0.0.9.1
|
|||||||
python-synology==0.2.0
|
python-synology==0.2.0
|
||||||
|
|
||||||
# homeassistant.components.tado
|
# homeassistant.components.tado
|
||||||
python-tado==0.2.8
|
python-tado==0.2.9
|
||||||
|
|
||||||
# homeassistant.components.telegram_bot
|
# homeassistant.components.telegram_bot
|
||||||
python-telegram-bot==11.1.0
|
python-telegram-bot==11.1.0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user