Skip to content

Commit

Permalink
Merge c30c449 into 77635d4
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelarnauts committed Mar 21, 2019
2 parents 77635d4 + c30c449 commit 3abfe37
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 6 deletions.
2 changes: 1 addition & 1 deletion homeassistant/components/tado/__init__.py
Expand Up @@ -10,7 +10,7 @@
from homeassistant.const import CONF_USERNAME, CONF_PASSWORD
from homeassistant.util import Throttle

REQUIREMENTS = ['python-tado==0.2.8']
REQUIREMENTS = ['python-tado==0.2.9']

_LOGGER = logging.getLogger(__name__)

Expand Down
26 changes: 24 additions & 2 deletions homeassistant/components/tado/climate.py
Expand Up @@ -3,7 +3,7 @@

from homeassistant.components.climate import ClimateDevice
from homeassistant.components.climate.const import (
SUPPORT_OPERATION_MODE, SUPPORT_TARGET_TEMPERATURE)
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
Expand Down Expand Up @@ -42,7 +42,8 @@
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):
Expand Down Expand Up @@ -200,6 +201,27 @@ def target_temperature(self):
"""Return the temperature we try to reach."""
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):
"""Set new target temperature."""
temperature = kwargs.get(ATTR_TEMPERATURE)
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/tado/device_tracker.py
Expand Up @@ -52,9 +52,9 @@ def __init__(self, hass, config):

# If there's a home_id, we need a different API URL
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:
self.tadoapiurl = 'https://auth.tado.com/api/v2' \
self.tadoapiurl = 'https://my.tado.com/api/v2' \
'/homes/{home_id}/mobileDevices'

# The API URL always needs a username and password
Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Expand Up @@ -1391,7 +1391,7 @@ python-songpal==0.0.9.1
python-synology==0.2.0

# homeassistant.components.tado
python-tado==0.2.8
python-tado==0.2.9

# homeassistant.components.telegram_bot
python-telegram-bot==11.1.0
Expand Down

0 comments on commit 3abfe37

Please sign in to comment.