2019-04-03 15:40:03 +00:00
|
|
|
"""Support for Radio Thermostat wifi-enabled home thermostats."""
|
2022-01-03 12:09:43 +00:00
|
|
|
from __future__ import annotations
|
|
|
|
|
2016-08-19 07:17:28 +00:00
|
|
|
import logging
|
2022-06-05 23:59:52 +00:00
|
|
|
from typing import Any
|
2016-08-19 07:17:28 +00:00
|
|
|
|
Climate 1.0 (#23899)
* Climate 1.0 / part 1/2/3
* fix flake
* Lint
* Update Google Assistant
* ambiclimate to climate 1.0 (#24911)
* Fix Alexa
* Lint
* Migrate zhong_hong
* Migrate tuya
* Migrate honeywell to new climate schema (#24257)
* Update one
* Fix model climate v2
* Cleanup p4
* Add comfort hold mode
* Fix old code
* Update homeassistant/components/climate/__init__.py
Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>
* Update homeassistant/components/climate/const.py
Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>
* First renaming
* Rename operation to hvac for paulus
* Rename hold mode to preset mode
* Cleanup & update comments
* Remove on/off
* Fix supported feature count
* Update services
* Update demo
* Fix tests & use current_hvac
* Update comment
* Fix tests & add typing
* Add more typing
* Update modes
* Fix tests
* Cleanup low/high with range
* Update homematic part 1
* Finish homematic
* Fix lint
* fix hm mapping
* Support simple devices
* convert lcn
* migrate oem
* Fix xs1
* update hive
* update mil
* Update toon
* migrate deconz
* cleanup
* update tesla
* Fix lint
* Fix vera
* Migrate zwave
* Migrate velbus
* Cleanup humity feature
* Cleanup
* Migrate wink
* migrate dyson
* Fix current hvac
* Renaming
* Fix lint
* Migrate tfiac
* migrate tado
* Fix PRESET can be None
* apply PR#23913 from dev
* remove EU component, etc.
* remove EU component, etc.
* ready to test now
* de-linted
* some tweaks
* de-lint
* better handling of edge cases
* delint
* fix set_mode typos
* apply PR#23913 from dev
* remove EU component, etc.
* ready to test now
* de-linted
* some tweaks
* de-lint
* better handling of edge cases
* delint
* fix set_mode typos
* delint, move debug code
* away preset now working
* code tidy-up
* code tidy-up 2
* code tidy-up 3
* address issues #18932, #15063
* address issues #18932, #15063 - 2/2
* refactor MODE_AUTO to MODE_HEAT_COOL and use F not C
* add low/high to set_temp
* add low/high to set_temp 2
* add low/high to set_temp - delint
* run HA scripts
* port changes from PR #24402
* manual rebase
* manual rebase 2
* delint
* minor change
* remove SUPPORT_HVAC_ACTION
* Migrate radiotherm
* Convert touchline
* Migrate flexit
* Migrate nuheat
* Migrate maxcube
* Fix names maxcube const
* Migrate proliphix
* Migrate heatmiser
* Migrate fritzbox
* Migrate opentherm_gw
* Migrate venstar
* Migrate daikin
* Migrate modbus
* Fix elif
* Migrate Homematic IP Cloud to climate-1.0 (#24913)
* hmip climate fix
* Update hvac_mode and preset_mode
* fix lint
* Fix lint
* Migrate generic_thermostat
* Migrate incomfort to new climate schema (#24915)
* initial commit
* Update climate.py
* Migrate eq3btsmart
* Lint
* cleanup PRESET_MANUAL
* Migrate ecobee
* No conditional features
* KNX: Migrate climate component to new climate platform (#24931)
* Migrate climate component
* Remove unused code
* Corrected line length
* Lint
* Lint
* fix tests
* Fix value
* Migrate geniushub to new climate schema (#24191)
* Update one
* Fix model climate v2
* Cleanup p4
* Add comfort hold mode
* Fix old code
* Update homeassistant/components/climate/__init__.py
Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>
* Update homeassistant/components/climate/const.py
Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>
* First renaming
* Rename operation to hvac for paulus
* Rename hold mode to preset mode
* Cleanup & update comments
* Remove on/off
* Fix supported feature count
* Update services
* Update demo
* Fix tests & use current_hvac
* Update comment
* Fix tests & add typing
* Add more typing
* Update modes
* Fix tests
* Cleanup low/high with range
* Update homematic part 1
* Finish homematic
* Fix lint
* fix hm mapping
* Support simple devices
* convert lcn
* migrate oem
* Fix xs1
* update hive
* update mil
* Update toon
* migrate deconz
* cleanup
* update tesla
* Fix lint
* Fix vera
* Migrate zwave
* Migrate velbus
* Cleanup humity feature
* Cleanup
* Migrate wink
* migrate dyson
* Fix current hvac
* Renaming
* Fix lint
* Migrate tfiac
* migrate tado
* delinted
* delinted
* use latest client
* clean up mappings
* clean up mappings
* add duration to set_temperature
* add duration to set_temperature
* manual rebase
* tweak
* fix regression
* small fix
* fix rebase mixup
* address comments
* finish refactor
* fix regression
* tweak type hints
* delint
* manual rebase
* WIP: Fixes for honeywell migration to climate-1.0 (#24938)
* add type hints
* code tidy-up
* Fixes for incomfort migration to climate-1.0 (#24936)
* delint type hints
* no async unless await
* revert: no async unless await
* revert: no async unless await 2
* delint
* fix typo
* Fix homekit_controller on climate-1.0 (#24948)
* Fix tests on climate-1.0 branch
* As part of climate-1.0, make state return the heating-cooling.current characteristic
* Fixes from review
* lint
* Fix imports
* Migrate stibel_eltron
* Fix lint
* Migrate coolmaster to climate 1.0 (#24967)
* Migrate coolmaster to climate 1.0
* fix lint errors
* More lint fixes
* Fix demo to work with UI
* Migrate spider
* Demo update
* Updated frontend to 20190705.0
* Fix boost mode (#24980)
* Prepare Netatmo for climate 1.0 (#24973)
* Migration Netatmo
* Address comments
* Update climate.py
* Migrate ephember
* Migrate Sensibo
* Implemented review comments (#24942)
* Migrate ESPHome
* Migrate MQTT
* Migrate Nest
* Migrate melissa
* Initial/partial migration of ST
* Migrate ST
* Remove Away mode (#24995)
* Migrate evohome, cache access tokens (#24491)
* add water_heater, add storage - initial commit
* add water_heater, add storage - initial commit
delint
add missing code
desiderata
update honeywell client library & CODEOWNER
add auth_tokens code, refactor & delint
refactor for broker
delint
* Add Broker, Water Heater & Refactor
add missing code
desiderata
* update honeywell client library & CODEOWNER
add auth_tokens code, refactor & delint
refactor for broker
* bugfix - loc_idx may not be 0
more refactor - ensure pure async
more refactoring
appears all r/o attributes are working
tweak precsion, DHW & delint
remove unused code
remove unused code 2
remove unused code, refactor _save_auth_tokens()
* support RoundThermostat
bugfix opmode, switch to util.dt, add until=1h
revert breaking change
* store at_expires as naive UTC
remove debug code
delint
tidy up exception handling
delint
add water_heater, add storage - initial commit
delint
add missing code
desiderata
update honeywell client library & CODEOWNER
add auth_tokens code, refactor & delint
refactor for broker
add water_heater, add storage - initial commit
delint
add missing code
desiderata
update honeywell client library & CODEOWNER
add auth_tokens code, refactor & delint
refactor for broker
delint
bugfix - loc_idx may not be 0
more refactor - ensure pure async
more refactoring
appears all r/o attributes are working
tweak precsion, DHW & delint
remove unused code
remove unused code 2
remove unused code, refactor _save_auth_tokens()
support RoundThermostat
bugfix opmode, switch to util.dt, add until=1h
revert breaking change
store at_expires as naive UTC
remove debug code
delint
tidy up exception handling
delint
* update CODEOWNERS
* fix regression
* fix requirements
* migrate to climate-1.0
* tweaking
* de-lint
* TCS working? & delint
* tweaking
* TCS code finalised
* remove available() logic
* refactor _switchpoints()
* tidy up switchpoint code
* tweak
* teaking device_state_attributes
* some refactoring
* move PRESET_CUSTOM back to evohome
* move CONF_ACCESS_TOKEN_EXPIRES CONF_REFRESH_TOKEN back to evohome
* refactor SP code and dt conversion
* delinted
* delinted
* remove water_heater
* fix regression
* Migrate homekit
* Cleanup away mode
* Fix tests
* add helpers
* fix tests melissa
* Fix nehueat
* fix zwave
* add more tests
* fix deconz
* Fix climate test emulate_hue
* fix tests
* fix dyson tests
* fix demo with new layout
* fix honeywell
* Switch homekit_controller to use HVAC_MODE_HEAT_COOL instead of HVAC_MODE_AUTO (#25009)
* Lint
* PyLint
* Pylint
* fix fritzbox tests
* Fix google
* Fix all tests
* Fix lint
* Fix auto for homekit like controler
* Fix lint
* fix lint
2019-07-08 12:00:24 +00:00
|
|
|
import radiotherm
|
2019-12-09 13:39:51 +00:00
|
|
|
import voluptuous as vol
|
2016-09-11 09:38:43 +00:00
|
|
|
|
2022-09-10 21:42:28 +00:00
|
|
|
from homeassistant.components.climate import (
|
2022-04-26 07:05:15 +00:00
|
|
|
FAN_AUTO,
|
2019-12-09 13:39:51 +00:00
|
|
|
FAN_OFF,
|
|
|
|
FAN_ON,
|
2022-09-10 21:42:28 +00:00
|
|
|
PLATFORM_SCHEMA,
|
2020-01-09 14:25:19 +00:00
|
|
|
PRESET_AWAY,
|
|
|
|
PRESET_HOME,
|
2022-09-10 21:42:28 +00:00
|
|
|
ClimateEntity,
|
2022-04-26 07:05:15 +00:00
|
|
|
ClimateEntityFeature,
|
|
|
|
HVACAction,
|
|
|
|
HVACMode,
|
2019-07-31 19:25:30 +00:00
|
|
|
)
|
2022-06-05 23:59:52 +00:00
|
|
|
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
|
2017-11-22 20:59:49 +00:00
|
|
|
from homeassistant.const import (
|
2019-07-31 19:25:30 +00:00
|
|
|
ATTR_TEMPERATURE,
|
|
|
|
CONF_HOST,
|
|
|
|
PRECISION_HALVES,
|
2022-12-02 18:56:18 +00:00
|
|
|
UnitOfTemperature,
|
2019-07-31 19:25:30 +00:00
|
|
|
)
|
2022-06-05 23:59:52 +00:00
|
|
|
from homeassistant.core import HomeAssistant, callback
|
2016-09-11 09:38:43 +00:00
|
|
|
import homeassistant.helpers.config_validation as cv
|
2022-01-03 12:09:43 +00:00
|
|
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
2022-08-25 13:33:05 +00:00
|
|
|
from homeassistant.helpers.issue_registry import IssueSeverity, async_create_issue
|
2022-01-03 12:09:43 +00:00
|
|
|
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
2016-08-19 07:17:28 +00:00
|
|
|
|
2022-06-05 23:59:52 +00:00
|
|
|
from . import DOMAIN
|
|
|
|
from .coordinator import RadioThermUpdateCoordinator
|
2022-06-08 00:26:06 +00:00
|
|
|
from .entity import RadioThermostatEntity
|
2022-06-05 23:59:52 +00:00
|
|
|
|
2016-08-19 07:17:28 +00:00
|
|
|
_LOGGER = logging.getLogger(__name__)
|
|
|
|
|
2019-09-06 20:05:46 +00:00
|
|
|
ATTR_FAN_ACTION = "fan_action"
|
2016-09-11 09:38:43 +00:00
|
|
|
|
2020-01-09 14:25:19 +00:00
|
|
|
PRESET_HOLIDAY = "holiday"
|
|
|
|
|
|
|
|
PRESET_ALTERNATE = "alternate"
|
|
|
|
|
2017-11-22 20:59:49 +00:00
|
|
|
STATE_CIRCULATE = "circulate"
|
|
|
|
|
2020-01-09 14:25:19 +00:00
|
|
|
PRESET_MODES = [PRESET_HOME, PRESET_ALTERNATE, PRESET_AWAY, PRESET_HOLIDAY]
|
|
|
|
|
2022-04-26 07:05:15 +00:00
|
|
|
OPERATION_LIST = [HVACMode.AUTO, HVACMode.COOL, HVACMode.HEAT, HVACMode.OFF]
|
|
|
|
CT30_FAN_OPERATION_LIST = [FAN_ON, FAN_AUTO]
|
|
|
|
CT80_FAN_OPERATION_LIST = [FAN_ON, STATE_CIRCULATE, FAN_AUTO]
|
2017-11-22 20:59:49 +00:00
|
|
|
|
2020-01-05 12:09:17 +00:00
|
|
|
# Mappings from radiotherm json data codes to and from Home Assistant state
|
2017-11-22 20:59:49 +00:00
|
|
|
# flags. CODE is the thermostat integer code and these map to and
|
2020-01-05 12:09:17 +00:00
|
|
|
# from Home Assistant state flags.
|
2017-11-22 20:59:49 +00:00
|
|
|
|
|
|
|
# Programmed temperature mode of the thermostat.
|
Climate 1.0 (#23899)
* Climate 1.0 / part 1/2/3
* fix flake
* Lint
* Update Google Assistant
* ambiclimate to climate 1.0 (#24911)
* Fix Alexa
* Lint
* Migrate zhong_hong
* Migrate tuya
* Migrate honeywell to new climate schema (#24257)
* Update one
* Fix model climate v2
* Cleanup p4
* Add comfort hold mode
* Fix old code
* Update homeassistant/components/climate/__init__.py
Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>
* Update homeassistant/components/climate/const.py
Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>
* First renaming
* Rename operation to hvac for paulus
* Rename hold mode to preset mode
* Cleanup & update comments
* Remove on/off
* Fix supported feature count
* Update services
* Update demo
* Fix tests & use current_hvac
* Update comment
* Fix tests & add typing
* Add more typing
* Update modes
* Fix tests
* Cleanup low/high with range
* Update homematic part 1
* Finish homematic
* Fix lint
* fix hm mapping
* Support simple devices
* convert lcn
* migrate oem
* Fix xs1
* update hive
* update mil
* Update toon
* migrate deconz
* cleanup
* update tesla
* Fix lint
* Fix vera
* Migrate zwave
* Migrate velbus
* Cleanup humity feature
* Cleanup
* Migrate wink
* migrate dyson
* Fix current hvac
* Renaming
* Fix lint
* Migrate tfiac
* migrate tado
* Fix PRESET can be None
* apply PR#23913 from dev
* remove EU component, etc.
* remove EU component, etc.
* ready to test now
* de-linted
* some tweaks
* de-lint
* better handling of edge cases
* delint
* fix set_mode typos
* apply PR#23913 from dev
* remove EU component, etc.
* ready to test now
* de-linted
* some tweaks
* de-lint
* better handling of edge cases
* delint
* fix set_mode typos
* delint, move debug code
* away preset now working
* code tidy-up
* code tidy-up 2
* code tidy-up 3
* address issues #18932, #15063
* address issues #18932, #15063 - 2/2
* refactor MODE_AUTO to MODE_HEAT_COOL and use F not C
* add low/high to set_temp
* add low/high to set_temp 2
* add low/high to set_temp - delint
* run HA scripts
* port changes from PR #24402
* manual rebase
* manual rebase 2
* delint
* minor change
* remove SUPPORT_HVAC_ACTION
* Migrate radiotherm
* Convert touchline
* Migrate flexit
* Migrate nuheat
* Migrate maxcube
* Fix names maxcube const
* Migrate proliphix
* Migrate heatmiser
* Migrate fritzbox
* Migrate opentherm_gw
* Migrate venstar
* Migrate daikin
* Migrate modbus
* Fix elif
* Migrate Homematic IP Cloud to climate-1.0 (#24913)
* hmip climate fix
* Update hvac_mode and preset_mode
* fix lint
* Fix lint
* Migrate generic_thermostat
* Migrate incomfort to new climate schema (#24915)
* initial commit
* Update climate.py
* Migrate eq3btsmart
* Lint
* cleanup PRESET_MANUAL
* Migrate ecobee
* No conditional features
* KNX: Migrate climate component to new climate platform (#24931)
* Migrate climate component
* Remove unused code
* Corrected line length
* Lint
* Lint
* fix tests
* Fix value
* Migrate geniushub to new climate schema (#24191)
* Update one
* Fix model climate v2
* Cleanup p4
* Add comfort hold mode
* Fix old code
* Update homeassistant/components/climate/__init__.py
Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>
* Update homeassistant/components/climate/const.py
Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>
* First renaming
* Rename operation to hvac for paulus
* Rename hold mode to preset mode
* Cleanup & update comments
* Remove on/off
* Fix supported feature count
* Update services
* Update demo
* Fix tests & use current_hvac
* Update comment
* Fix tests & add typing
* Add more typing
* Update modes
* Fix tests
* Cleanup low/high with range
* Update homematic part 1
* Finish homematic
* Fix lint
* fix hm mapping
* Support simple devices
* convert lcn
* migrate oem
* Fix xs1
* update hive
* update mil
* Update toon
* migrate deconz
* cleanup
* update tesla
* Fix lint
* Fix vera
* Migrate zwave
* Migrate velbus
* Cleanup humity feature
* Cleanup
* Migrate wink
* migrate dyson
* Fix current hvac
* Renaming
* Fix lint
* Migrate tfiac
* migrate tado
* delinted
* delinted
* use latest client
* clean up mappings
* clean up mappings
* add duration to set_temperature
* add duration to set_temperature
* manual rebase
* tweak
* fix regression
* small fix
* fix rebase mixup
* address comments
* finish refactor
* fix regression
* tweak type hints
* delint
* manual rebase
* WIP: Fixes for honeywell migration to climate-1.0 (#24938)
* add type hints
* code tidy-up
* Fixes for incomfort migration to climate-1.0 (#24936)
* delint type hints
* no async unless await
* revert: no async unless await
* revert: no async unless await 2
* delint
* fix typo
* Fix homekit_controller on climate-1.0 (#24948)
* Fix tests on climate-1.0 branch
* As part of climate-1.0, make state return the heating-cooling.current characteristic
* Fixes from review
* lint
* Fix imports
* Migrate stibel_eltron
* Fix lint
* Migrate coolmaster to climate 1.0 (#24967)
* Migrate coolmaster to climate 1.0
* fix lint errors
* More lint fixes
* Fix demo to work with UI
* Migrate spider
* Demo update
* Updated frontend to 20190705.0
* Fix boost mode (#24980)
* Prepare Netatmo for climate 1.0 (#24973)
* Migration Netatmo
* Address comments
* Update climate.py
* Migrate ephember
* Migrate Sensibo
* Implemented review comments (#24942)
* Migrate ESPHome
* Migrate MQTT
* Migrate Nest
* Migrate melissa
* Initial/partial migration of ST
* Migrate ST
* Remove Away mode (#24995)
* Migrate evohome, cache access tokens (#24491)
* add water_heater, add storage - initial commit
* add water_heater, add storage - initial commit
delint
add missing code
desiderata
update honeywell client library & CODEOWNER
add auth_tokens code, refactor & delint
refactor for broker
delint
* Add Broker, Water Heater & Refactor
add missing code
desiderata
* update honeywell client library & CODEOWNER
add auth_tokens code, refactor & delint
refactor for broker
* bugfix - loc_idx may not be 0
more refactor - ensure pure async
more refactoring
appears all r/o attributes are working
tweak precsion, DHW & delint
remove unused code
remove unused code 2
remove unused code, refactor _save_auth_tokens()
* support RoundThermostat
bugfix opmode, switch to util.dt, add until=1h
revert breaking change
* store at_expires as naive UTC
remove debug code
delint
tidy up exception handling
delint
add water_heater, add storage - initial commit
delint
add missing code
desiderata
update honeywell client library & CODEOWNER
add auth_tokens code, refactor & delint
refactor for broker
add water_heater, add storage - initial commit
delint
add missing code
desiderata
update honeywell client library & CODEOWNER
add auth_tokens code, refactor & delint
refactor for broker
delint
bugfix - loc_idx may not be 0
more refactor - ensure pure async
more refactoring
appears all r/o attributes are working
tweak precsion, DHW & delint
remove unused code
remove unused code 2
remove unused code, refactor _save_auth_tokens()
support RoundThermostat
bugfix opmode, switch to util.dt, add until=1h
revert breaking change
store at_expires as naive UTC
remove debug code
delint
tidy up exception handling
delint
* update CODEOWNERS
* fix regression
* fix requirements
* migrate to climate-1.0
* tweaking
* de-lint
* TCS working? & delint
* tweaking
* TCS code finalised
* remove available() logic
* refactor _switchpoints()
* tidy up switchpoint code
* tweak
* teaking device_state_attributes
* some refactoring
* move PRESET_CUSTOM back to evohome
* move CONF_ACCESS_TOKEN_EXPIRES CONF_REFRESH_TOKEN back to evohome
* refactor SP code and dt conversion
* delinted
* delinted
* remove water_heater
* fix regression
* Migrate homekit
* Cleanup away mode
* Fix tests
* add helpers
* fix tests melissa
* Fix nehueat
* fix zwave
* add more tests
* fix deconz
* Fix climate test emulate_hue
* fix tests
* fix dyson tests
* fix demo with new layout
* fix honeywell
* Switch homekit_controller to use HVAC_MODE_HEAT_COOL instead of HVAC_MODE_AUTO (#25009)
* Lint
* PyLint
* Pylint
* fix fritzbox tests
* Fix google
* Fix all tests
* Fix lint
* Fix auto for homekit like controler
* Fix lint
* fix lint
2019-07-08 12:00:24 +00:00
|
|
|
CODE_TO_TEMP_MODE = {
|
2022-04-26 07:05:15 +00:00
|
|
|
0: HVACMode.OFF,
|
|
|
|
1: HVACMode.HEAT,
|
|
|
|
2: HVACMode.COOL,
|
|
|
|
3: HVACMode.AUTO,
|
Climate 1.0 (#23899)
* Climate 1.0 / part 1/2/3
* fix flake
* Lint
* Update Google Assistant
* ambiclimate to climate 1.0 (#24911)
* Fix Alexa
* Lint
* Migrate zhong_hong
* Migrate tuya
* Migrate honeywell to new climate schema (#24257)
* Update one
* Fix model climate v2
* Cleanup p4
* Add comfort hold mode
* Fix old code
* Update homeassistant/components/climate/__init__.py
Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>
* Update homeassistant/components/climate/const.py
Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>
* First renaming
* Rename operation to hvac for paulus
* Rename hold mode to preset mode
* Cleanup & update comments
* Remove on/off
* Fix supported feature count
* Update services
* Update demo
* Fix tests & use current_hvac
* Update comment
* Fix tests & add typing
* Add more typing
* Update modes
* Fix tests
* Cleanup low/high with range
* Update homematic part 1
* Finish homematic
* Fix lint
* fix hm mapping
* Support simple devices
* convert lcn
* migrate oem
* Fix xs1
* update hive
* update mil
* Update toon
* migrate deconz
* cleanup
* update tesla
* Fix lint
* Fix vera
* Migrate zwave
* Migrate velbus
* Cleanup humity feature
* Cleanup
* Migrate wink
* migrate dyson
* Fix current hvac
* Renaming
* Fix lint
* Migrate tfiac
* migrate tado
* Fix PRESET can be None
* apply PR#23913 from dev
* remove EU component, etc.
* remove EU component, etc.
* ready to test now
* de-linted
* some tweaks
* de-lint
* better handling of edge cases
* delint
* fix set_mode typos
* apply PR#23913 from dev
* remove EU component, etc.
* ready to test now
* de-linted
* some tweaks
* de-lint
* better handling of edge cases
* delint
* fix set_mode typos
* delint, move debug code
* away preset now working
* code tidy-up
* code tidy-up 2
* code tidy-up 3
* address issues #18932, #15063
* address issues #18932, #15063 - 2/2
* refactor MODE_AUTO to MODE_HEAT_COOL and use F not C
* add low/high to set_temp
* add low/high to set_temp 2
* add low/high to set_temp - delint
* run HA scripts
* port changes from PR #24402
* manual rebase
* manual rebase 2
* delint
* minor change
* remove SUPPORT_HVAC_ACTION
* Migrate radiotherm
* Convert touchline
* Migrate flexit
* Migrate nuheat
* Migrate maxcube
* Fix names maxcube const
* Migrate proliphix
* Migrate heatmiser
* Migrate fritzbox
* Migrate opentherm_gw
* Migrate venstar
* Migrate daikin
* Migrate modbus
* Fix elif
* Migrate Homematic IP Cloud to climate-1.0 (#24913)
* hmip climate fix
* Update hvac_mode and preset_mode
* fix lint
* Fix lint
* Migrate generic_thermostat
* Migrate incomfort to new climate schema (#24915)
* initial commit
* Update climate.py
* Migrate eq3btsmart
* Lint
* cleanup PRESET_MANUAL
* Migrate ecobee
* No conditional features
* KNX: Migrate climate component to new climate platform (#24931)
* Migrate climate component
* Remove unused code
* Corrected line length
* Lint
* Lint
* fix tests
* Fix value
* Migrate geniushub to new climate schema (#24191)
* Update one
* Fix model climate v2
* Cleanup p4
* Add comfort hold mode
* Fix old code
* Update homeassistant/components/climate/__init__.py
Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>
* Update homeassistant/components/climate/const.py
Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>
* First renaming
* Rename operation to hvac for paulus
* Rename hold mode to preset mode
* Cleanup & update comments
* Remove on/off
* Fix supported feature count
* Update services
* Update demo
* Fix tests & use current_hvac
* Update comment
* Fix tests & add typing
* Add more typing
* Update modes
* Fix tests
* Cleanup low/high with range
* Update homematic part 1
* Finish homematic
* Fix lint
* fix hm mapping
* Support simple devices
* convert lcn
* migrate oem
* Fix xs1
* update hive
* update mil
* Update toon
* migrate deconz
* cleanup
* update tesla
* Fix lint
* Fix vera
* Migrate zwave
* Migrate velbus
* Cleanup humity feature
* Cleanup
* Migrate wink
* migrate dyson
* Fix current hvac
* Renaming
* Fix lint
* Migrate tfiac
* migrate tado
* delinted
* delinted
* use latest client
* clean up mappings
* clean up mappings
* add duration to set_temperature
* add duration to set_temperature
* manual rebase
* tweak
* fix regression
* small fix
* fix rebase mixup
* address comments
* finish refactor
* fix regression
* tweak type hints
* delint
* manual rebase
* WIP: Fixes for honeywell migration to climate-1.0 (#24938)
* add type hints
* code tidy-up
* Fixes for incomfort migration to climate-1.0 (#24936)
* delint type hints
* no async unless await
* revert: no async unless await
* revert: no async unless await 2
* delint
* fix typo
* Fix homekit_controller on climate-1.0 (#24948)
* Fix tests on climate-1.0 branch
* As part of climate-1.0, make state return the heating-cooling.current characteristic
* Fixes from review
* lint
* Fix imports
* Migrate stibel_eltron
* Fix lint
* Migrate coolmaster to climate 1.0 (#24967)
* Migrate coolmaster to climate 1.0
* fix lint errors
* More lint fixes
* Fix demo to work with UI
* Migrate spider
* Demo update
* Updated frontend to 20190705.0
* Fix boost mode (#24980)
* Prepare Netatmo for climate 1.0 (#24973)
* Migration Netatmo
* Address comments
* Update climate.py
* Migrate ephember
* Migrate Sensibo
* Implemented review comments (#24942)
* Migrate ESPHome
* Migrate MQTT
* Migrate Nest
* Migrate melissa
* Initial/partial migration of ST
* Migrate ST
* Remove Away mode (#24995)
* Migrate evohome, cache access tokens (#24491)
* add water_heater, add storage - initial commit
* add water_heater, add storage - initial commit
delint
add missing code
desiderata
update honeywell client library & CODEOWNER
add auth_tokens code, refactor & delint
refactor for broker
delint
* Add Broker, Water Heater & Refactor
add missing code
desiderata
* update honeywell client library & CODEOWNER
add auth_tokens code, refactor & delint
refactor for broker
* bugfix - loc_idx may not be 0
more refactor - ensure pure async
more refactoring
appears all r/o attributes are working
tweak precsion, DHW & delint
remove unused code
remove unused code 2
remove unused code, refactor _save_auth_tokens()
* support RoundThermostat
bugfix opmode, switch to util.dt, add until=1h
revert breaking change
* store at_expires as naive UTC
remove debug code
delint
tidy up exception handling
delint
add water_heater, add storage - initial commit
delint
add missing code
desiderata
update honeywell client library & CODEOWNER
add auth_tokens code, refactor & delint
refactor for broker
add water_heater, add storage - initial commit
delint
add missing code
desiderata
update honeywell client library & CODEOWNER
add auth_tokens code, refactor & delint
refactor for broker
delint
bugfix - loc_idx may not be 0
more refactor - ensure pure async
more refactoring
appears all r/o attributes are working
tweak precsion, DHW & delint
remove unused code
remove unused code 2
remove unused code, refactor _save_auth_tokens()
support RoundThermostat
bugfix opmode, switch to util.dt, add until=1h
revert breaking change
store at_expires as naive UTC
remove debug code
delint
tidy up exception handling
delint
* update CODEOWNERS
* fix regression
* fix requirements
* migrate to climate-1.0
* tweaking
* de-lint
* TCS working? & delint
* tweaking
* TCS code finalised
* remove available() logic
* refactor _switchpoints()
* tidy up switchpoint code
* tweak
* teaking device_state_attributes
* some refactoring
* move PRESET_CUSTOM back to evohome
* move CONF_ACCESS_TOKEN_EXPIRES CONF_REFRESH_TOKEN back to evohome
* refactor SP code and dt conversion
* delinted
* delinted
* remove water_heater
* fix regression
* Migrate homekit
* Cleanup away mode
* Fix tests
* add helpers
* fix tests melissa
* Fix nehueat
* fix zwave
* add more tests
* fix deconz
* Fix climate test emulate_hue
* fix tests
* fix dyson tests
* fix demo with new layout
* fix honeywell
* Switch homekit_controller to use HVAC_MODE_HEAT_COOL instead of HVAC_MODE_AUTO (#25009)
* Lint
* PyLint
* Pylint
* fix fritzbox tests
* Fix google
* Fix all tests
* Fix lint
* Fix auto for homekit like controler
* Fix lint
* fix lint
2019-07-08 12:00:24 +00:00
|
|
|
}
|
2017-11-22 20:59:49 +00:00
|
|
|
TEMP_MODE_TO_CODE = {v: k for k, v in CODE_TO_TEMP_MODE.items()}
|
|
|
|
|
|
|
|
# Programmed fan mode (circulate is supported by CT80 models)
|
2022-04-26 07:05:15 +00:00
|
|
|
CODE_TO_FAN_MODE = {0: FAN_AUTO, 1: STATE_CIRCULATE, 2: FAN_ON}
|
2020-01-09 14:25:19 +00:00
|
|
|
|
2017-11-22 20:59:49 +00:00
|
|
|
FAN_MODE_TO_CODE = {v: k for k, v in CODE_TO_FAN_MODE.items()}
|
|
|
|
|
|
|
|
# Active thermostat state (is it heating or cooling?). In the future
|
|
|
|
# this should probably made into heat and cool binary sensors.
|
2022-04-26 07:05:15 +00:00
|
|
|
CODE_TO_TEMP_STATE = {0: HVACAction.IDLE, 1: HVACAction.HEATING, 2: HVACAction.COOLING}
|
2017-11-22 20:59:49 +00:00
|
|
|
|
|
|
|
# Active fan state. This is if the fan is actually on or not. In the
|
|
|
|
# future this should probably made into a binary sensor for the fan.
|
2019-09-06 20:05:46 +00:00
|
|
|
CODE_TO_FAN_STATE = {0: FAN_OFF, 1: FAN_ON}
|
2017-11-22 20:59:49 +00:00
|
|
|
|
2022-06-05 23:59:52 +00:00
|
|
|
PRESET_MODE_TO_CODE = {
|
|
|
|
PRESET_HOME: 0,
|
|
|
|
PRESET_ALTERNATE: 1,
|
|
|
|
PRESET_AWAY: 2,
|
|
|
|
PRESET_HOLIDAY: 3,
|
|
|
|
}
|
2020-01-09 14:25:19 +00:00
|
|
|
|
2022-06-05 23:59:52 +00:00
|
|
|
CODE_TO_PRESET_MODE = {v: k for k, v in PRESET_MODE_TO_CODE.items()}
|
2020-01-09 14:25:19 +00:00
|
|
|
|
2021-08-02 12:57:10 +00:00
|
|
|
|
2022-06-05 23:59:52 +00:00
|
|
|
PARALLEL_UPDATES = 1
|
|
|
|
|
2022-06-08 00:26:06 +00:00
|
|
|
CONF_HOLD_TEMP = "hold_temp"
|
|
|
|
|
2017-11-22 20:59:49 +00:00
|
|
|
|
|
|
|
def round_temp(temperature):
|
|
|
|
"""Round a temperature to the resolution of the thermostat.
|
|
|
|
|
|
|
|
RadioThermostats can handle 0.5 degree temps so the input
|
|
|
|
temperature is rounded to that value and returned.
|
|
|
|
"""
|
|
|
|
return round(temperature * 2.0) / 2.0
|
|
|
|
|
|
|
|
|
2019-07-31 19:25:30 +00:00
|
|
|
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
|
|
|
{
|
|
|
|
vol.Optional(CONF_HOST): vol.All(cv.ensure_list, [cv.string]),
|
|
|
|
vol.Optional(CONF_HOLD_TEMP, default=False): cv.boolean,
|
|
|
|
}
|
|
|
|
)
|
2016-09-11 09:38:43 +00:00
|
|
|
|
2020-01-09 14:25:19 +00:00
|
|
|
|
2022-06-05 23:59:52 +00:00
|
|
|
async def async_setup_entry(
|
|
|
|
hass: HomeAssistant,
|
|
|
|
entry: ConfigEntry,
|
|
|
|
async_add_entities: AddEntitiesCallback,
|
|
|
|
) -> None:
|
|
|
|
"""Set up climate for a radiotherm device."""
|
|
|
|
coordinator: RadioThermUpdateCoordinator = hass.data[DOMAIN][entry.entry_id]
|
|
|
|
async_add_entities([RadioThermostat(coordinator)])
|
|
|
|
|
|
|
|
|
|
|
|
async def async_setup_platform(
|
2022-01-03 12:09:43 +00:00
|
|
|
hass: HomeAssistant,
|
|
|
|
config: ConfigType,
|
2022-06-05 23:59:52 +00:00
|
|
|
async_add_entities: AddEntitiesCallback,
|
2022-01-03 12:09:43 +00:00
|
|
|
discovery_info: DiscoveryInfoType | None = None,
|
|
|
|
) -> None:
|
2017-04-30 05:04:49 +00:00
|
|
|
"""Set up the Radio Thermostat."""
|
2022-07-25 10:31:53 +00:00
|
|
|
async_create_issue(
|
|
|
|
hass,
|
|
|
|
DOMAIN,
|
|
|
|
"deprecated_yaml",
|
|
|
|
breaks_in_ha_version="2022.9.0",
|
|
|
|
is_fixable=False,
|
|
|
|
severity=IssueSeverity.WARNING,
|
|
|
|
translation_key="deprecated_yaml",
|
|
|
|
)
|
2022-06-05 23:59:52 +00:00
|
|
|
_LOGGER.warning(
|
2022-12-23 12:27:27 +00:00
|
|
|
"Configuration of the Radio Thermostat climate platform in YAML is deprecated"
|
|
|
|
" and will be removed in Home Assistant 2022.9; Your existing configuration has"
|
|
|
|
" been imported into the UI automatically and can be safely removed from your"
|
|
|
|
" configuration.yaml file"
|
2022-06-05 23:59:52 +00:00
|
|
|
)
|
2022-07-25 10:31:53 +00:00
|
|
|
|
2022-06-05 23:59:52 +00:00
|
|
|
hosts: list[str] = []
|
2016-08-19 07:17:28 +00:00
|
|
|
if CONF_HOST in config:
|
|
|
|
hosts = config[CONF_HOST]
|
|
|
|
else:
|
2022-06-05 23:59:52 +00:00
|
|
|
hosts.append(
|
|
|
|
await hass.async_add_executor_job(radiotherm.discover.discover_address)
|
|
|
|
)
|
2016-08-19 07:17:28 +00:00
|
|
|
|
2022-06-05 23:59:52 +00:00
|
|
|
if not hosts:
|
2016-09-11 09:38:43 +00:00
|
|
|
_LOGGER.error("No Radiotherm Thermostats detected")
|
2022-06-05 23:59:52 +00:00
|
|
|
return
|
2016-08-19 07:17:28 +00:00
|
|
|
|
|
|
|
for host in hosts:
|
2022-06-05 23:59:52 +00:00
|
|
|
hass.async_create_task(
|
|
|
|
hass.config_entries.flow.async_init(
|
|
|
|
DOMAIN,
|
|
|
|
context={"source": SOURCE_IMPORT},
|
2022-06-08 00:26:06 +00:00
|
|
|
data={CONF_HOST: host},
|
2022-06-05 23:59:52 +00:00
|
|
|
)
|
|
|
|
)
|
2016-08-19 07:17:28 +00:00
|
|
|
|
|
|
|
|
2022-06-08 00:26:06 +00:00
|
|
|
class RadioThermostat(RadioThermostatEntity, ClimateEntity):
|
2016-08-19 07:17:28 +00:00
|
|
|
"""Representation of a Radio Thermostat."""
|
|
|
|
|
2022-04-26 07:05:15 +00:00
|
|
|
_attr_hvac_modes = OPERATION_LIST
|
2022-12-02 18:56:18 +00:00
|
|
|
_attr_temperature_unit = UnitOfTemperature.FAHRENHEIT
|
2022-06-05 23:59:52 +00:00
|
|
|
_attr_precision = PRECISION_HALVES
|
2022-04-07 12:55:09 +00:00
|
|
|
|
2022-06-05 23:59:52 +00:00
|
|
|
def __init__(self, coordinator: RadioThermUpdateCoordinator) -> None:
|
2016-08-19 07:17:28 +00:00
|
|
|
"""Initialize the thermostat."""
|
2022-06-05 23:59:52 +00:00
|
|
|
super().__init__(coordinator)
|
2022-06-08 00:26:06 +00:00
|
|
|
self._attr_name = self.init_data.name
|
|
|
|
self._attr_unique_id = self.init_data.mac
|
|
|
|
self._attr_fan_modes = CT30_FAN_OPERATION_LIST
|
2022-06-05 23:59:52 +00:00
|
|
|
self._attr_supported_features = (
|
|
|
|
ClimateEntityFeature.TARGET_TEMPERATURE | ClimateEntityFeature.FAN_MODE
|
|
|
|
)
|
2022-06-08 00:26:06 +00:00
|
|
|
if not isinstance(self.device, radiotherm.thermostat.CT80):
|
2022-06-05 23:59:52 +00:00
|
|
|
return
|
|
|
|
self._attr_fan_modes = CT80_FAN_OPERATION_LIST
|
|
|
|
self._attr_supported_features |= ClimateEntityFeature.PRESET_MODE
|
|
|
|
self._attr_preset_modes = PRESET_MODES
|
|
|
|
|
|
|
|
async def async_set_fan_mode(self, fan_mode: str) -> None:
|
2017-11-22 20:59:49 +00:00
|
|
|
"""Turn fan on/off."""
|
2022-06-05 23:59:52 +00:00
|
|
|
if (code := FAN_MODE_TO_CODE.get(fan_mode)) is None:
|
2022-06-08 00:26:06 +00:00
|
|
|
raise ValueError(f"{fan_mode} is not a valid fan mode")
|
2022-06-05 23:59:52 +00:00
|
|
|
await self.hass.async_add_executor_job(self._set_fan_mode, code)
|
|
|
|
self._attr_fan_mode = fan_mode
|
|
|
|
self.async_write_ha_state()
|
|
|
|
await self.coordinator.async_request_refresh()
|
|
|
|
|
|
|
|
def _set_fan_mode(self, code: int) -> None:
|
|
|
|
"""Turn fan on/off."""
|
|
|
|
self.device.fmode = code
|
2020-01-09 14:25:19 +00:00
|
|
|
|
2022-06-05 23:59:52 +00:00
|
|
|
@callback
|
|
|
|
def _process_data(self) -> None:
|
2017-07-11 08:12:51 +00:00
|
|
|
"""Update and validate the data from the thermostat."""
|
2022-06-05 23:59:52 +00:00
|
|
|
data = self.data.tstat
|
2022-06-08 00:26:06 +00:00
|
|
|
if isinstance(self.device, radiotherm.thermostat.CT80):
|
2022-06-05 23:59:52 +00:00
|
|
|
self._attr_current_humidity = self.data.humidity
|
|
|
|
self._attr_preset_mode = CODE_TO_PRESET_MODE[data["program_mode"]]
|
|
|
|
# Map thermostat values into various STATE_ flags.
|
|
|
|
self._attr_current_temperature = data["temp"]
|
|
|
|
self._attr_fan_mode = CODE_TO_FAN_MODE[data["fmode"]]
|
|
|
|
self._attr_extra_state_attributes = {
|
|
|
|
ATTR_FAN_ACTION: CODE_TO_FAN_STATE[data["fstate"]]
|
|
|
|
}
|
|
|
|
self._attr_hvac_mode = CODE_TO_TEMP_MODE[data["tmode"]]
|
|
|
|
if self.hvac_mode == HVACMode.OFF:
|
|
|
|
self._attr_hvac_action = None
|
2021-01-24 23:01:41 +00:00
|
|
|
else:
|
2022-06-05 23:59:52 +00:00
|
|
|
self._attr_hvac_action = CODE_TO_TEMP_STATE[data["tstate"]]
|
|
|
|
if self.hvac_mode == HVACMode.COOL:
|
|
|
|
self._attr_target_temperature = data["t_cool"]
|
|
|
|
elif self.hvac_mode == HVACMode.HEAT:
|
|
|
|
self._attr_target_temperature = data["t_heat"]
|
|
|
|
elif self.hvac_mode == HVACMode.AUTO:
|
|
|
|
# This doesn't really work - tstate is only set if the HVAC is
|
|
|
|
# active. If it's idle, we don't know what to do with the target
|
|
|
|
# temperature.
|
|
|
|
if self.hvac_action == HVACAction.COOLING:
|
|
|
|
self._attr_target_temperature = data["t_cool"]
|
|
|
|
elif self.hvac_action == HVACAction.HEATING:
|
|
|
|
self._attr_target_temperature = data["t_heat"]
|
|
|
|
|
|
|
|
async def async_set_temperature(self, **kwargs: Any) -> None:
|
2016-08-19 07:17:28 +00:00
|
|
|
"""Set new target temperature."""
|
2021-10-21 06:33:10 +00:00
|
|
|
if (temperature := kwargs.get(ATTR_TEMPERATURE)) is None:
|
2016-09-09 17:06:53 +00:00
|
|
|
return
|
2022-06-08 00:26:06 +00:00
|
|
|
await self.hass.async_add_executor_job(self._set_temperature, temperature)
|
2022-06-05 23:59:52 +00:00
|
|
|
self._attr_target_temperature = temperature
|
|
|
|
self.async_write_ha_state()
|
|
|
|
await self.coordinator.async_request_refresh()
|
|
|
|
|
2022-06-08 00:26:06 +00:00
|
|
|
def _set_temperature(self, temperature: int) -> None:
|
2022-06-05 23:59:52 +00:00
|
|
|
"""Set new target temperature."""
|
2017-11-22 20:59:49 +00:00
|
|
|
temperature = round_temp(temperature)
|
2022-06-05 23:59:52 +00:00
|
|
|
if self.hvac_mode == HVACMode.COOL:
|
2018-08-26 19:25:39 +00:00
|
|
|
self.device.t_cool = temperature
|
2022-06-05 23:59:52 +00:00
|
|
|
elif self.hvac_mode == HVACMode.HEAT:
|
2018-08-26 19:25:39 +00:00
|
|
|
self.device.t_heat = temperature
|
2022-06-05 23:59:52 +00:00
|
|
|
elif self.hvac_mode == HVACMode.AUTO:
|
|
|
|
if self.hvac_action == HVACAction.COOLING:
|
2018-08-26 19:25:39 +00:00
|
|
|
self.device.t_cool = temperature
|
2022-06-05 23:59:52 +00:00
|
|
|
elif self.hvac_action == HVACAction.HEATING:
|
2018-08-26 19:25:39 +00:00
|
|
|
self.device.t_heat = temperature
|
2017-11-22 20:59:49 +00:00
|
|
|
|
2022-06-05 23:59:52 +00:00
|
|
|
async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None:
|
|
|
|
"""Set operation mode (auto, cool, heat, off)."""
|
|
|
|
await self.hass.async_add_executor_job(self._set_hvac_mode, hvac_mode)
|
|
|
|
self._attr_hvac_mode = hvac_mode
|
|
|
|
self.async_write_ha_state()
|
|
|
|
await self.coordinator.async_request_refresh()
|
|
|
|
|
|
|
|
def _set_hvac_mode(self, hvac_mode: HVACMode) -> None:
|
2016-08-19 07:17:28 +00:00
|
|
|
"""Set operation mode (auto, cool, heat, off)."""
|
2022-04-26 07:05:15 +00:00
|
|
|
if hvac_mode in (HVACMode.OFF, HVACMode.AUTO):
|
Climate 1.0 (#23899)
* Climate 1.0 / part 1/2/3
* fix flake
* Lint
* Update Google Assistant
* ambiclimate to climate 1.0 (#24911)
* Fix Alexa
* Lint
* Migrate zhong_hong
* Migrate tuya
* Migrate honeywell to new climate schema (#24257)
* Update one
* Fix model climate v2
* Cleanup p4
* Add comfort hold mode
* Fix old code
* Update homeassistant/components/climate/__init__.py
Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>
* Update homeassistant/components/climate/const.py
Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>
* First renaming
* Rename operation to hvac for paulus
* Rename hold mode to preset mode
* Cleanup & update comments
* Remove on/off
* Fix supported feature count
* Update services
* Update demo
* Fix tests & use current_hvac
* Update comment
* Fix tests & add typing
* Add more typing
* Update modes
* Fix tests
* Cleanup low/high with range
* Update homematic part 1
* Finish homematic
* Fix lint
* fix hm mapping
* Support simple devices
* convert lcn
* migrate oem
* Fix xs1
* update hive
* update mil
* Update toon
* migrate deconz
* cleanup
* update tesla
* Fix lint
* Fix vera
* Migrate zwave
* Migrate velbus
* Cleanup humity feature
* Cleanup
* Migrate wink
* migrate dyson
* Fix current hvac
* Renaming
* Fix lint
* Migrate tfiac
* migrate tado
* Fix PRESET can be None
* apply PR#23913 from dev
* remove EU component, etc.
* remove EU component, etc.
* ready to test now
* de-linted
* some tweaks
* de-lint
* better handling of edge cases
* delint
* fix set_mode typos
* apply PR#23913 from dev
* remove EU component, etc.
* ready to test now
* de-linted
* some tweaks
* de-lint
* better handling of edge cases
* delint
* fix set_mode typos
* delint, move debug code
* away preset now working
* code tidy-up
* code tidy-up 2
* code tidy-up 3
* address issues #18932, #15063
* address issues #18932, #15063 - 2/2
* refactor MODE_AUTO to MODE_HEAT_COOL and use F not C
* add low/high to set_temp
* add low/high to set_temp 2
* add low/high to set_temp - delint
* run HA scripts
* port changes from PR #24402
* manual rebase
* manual rebase 2
* delint
* minor change
* remove SUPPORT_HVAC_ACTION
* Migrate radiotherm
* Convert touchline
* Migrate flexit
* Migrate nuheat
* Migrate maxcube
* Fix names maxcube const
* Migrate proliphix
* Migrate heatmiser
* Migrate fritzbox
* Migrate opentherm_gw
* Migrate venstar
* Migrate daikin
* Migrate modbus
* Fix elif
* Migrate Homematic IP Cloud to climate-1.0 (#24913)
* hmip climate fix
* Update hvac_mode and preset_mode
* fix lint
* Fix lint
* Migrate generic_thermostat
* Migrate incomfort to new climate schema (#24915)
* initial commit
* Update climate.py
* Migrate eq3btsmart
* Lint
* cleanup PRESET_MANUAL
* Migrate ecobee
* No conditional features
* KNX: Migrate climate component to new climate platform (#24931)
* Migrate climate component
* Remove unused code
* Corrected line length
* Lint
* Lint
* fix tests
* Fix value
* Migrate geniushub to new climate schema (#24191)
* Update one
* Fix model climate v2
* Cleanup p4
* Add comfort hold mode
* Fix old code
* Update homeassistant/components/climate/__init__.py
Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>
* Update homeassistant/components/climate/const.py
Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>
* First renaming
* Rename operation to hvac for paulus
* Rename hold mode to preset mode
* Cleanup & update comments
* Remove on/off
* Fix supported feature count
* Update services
* Update demo
* Fix tests & use current_hvac
* Update comment
* Fix tests & add typing
* Add more typing
* Update modes
* Fix tests
* Cleanup low/high with range
* Update homematic part 1
* Finish homematic
* Fix lint
* fix hm mapping
* Support simple devices
* convert lcn
* migrate oem
* Fix xs1
* update hive
* update mil
* Update toon
* migrate deconz
* cleanup
* update tesla
* Fix lint
* Fix vera
* Migrate zwave
* Migrate velbus
* Cleanup humity feature
* Cleanup
* Migrate wink
* migrate dyson
* Fix current hvac
* Renaming
* Fix lint
* Migrate tfiac
* migrate tado
* delinted
* delinted
* use latest client
* clean up mappings
* clean up mappings
* add duration to set_temperature
* add duration to set_temperature
* manual rebase
* tweak
* fix regression
* small fix
* fix rebase mixup
* address comments
* finish refactor
* fix regression
* tweak type hints
* delint
* manual rebase
* WIP: Fixes for honeywell migration to climate-1.0 (#24938)
* add type hints
* code tidy-up
* Fixes for incomfort migration to climate-1.0 (#24936)
* delint type hints
* no async unless await
* revert: no async unless await
* revert: no async unless await 2
* delint
* fix typo
* Fix homekit_controller on climate-1.0 (#24948)
* Fix tests on climate-1.0 branch
* As part of climate-1.0, make state return the heating-cooling.current characteristic
* Fixes from review
* lint
* Fix imports
* Migrate stibel_eltron
* Fix lint
* Migrate coolmaster to climate 1.0 (#24967)
* Migrate coolmaster to climate 1.0
* fix lint errors
* More lint fixes
* Fix demo to work with UI
* Migrate spider
* Demo update
* Updated frontend to 20190705.0
* Fix boost mode (#24980)
* Prepare Netatmo for climate 1.0 (#24973)
* Migration Netatmo
* Address comments
* Update climate.py
* Migrate ephember
* Migrate Sensibo
* Implemented review comments (#24942)
* Migrate ESPHome
* Migrate MQTT
* Migrate Nest
* Migrate melissa
* Initial/partial migration of ST
* Migrate ST
* Remove Away mode (#24995)
* Migrate evohome, cache access tokens (#24491)
* add water_heater, add storage - initial commit
* add water_heater, add storage - initial commit
delint
add missing code
desiderata
update honeywell client library & CODEOWNER
add auth_tokens code, refactor & delint
refactor for broker
delint
* Add Broker, Water Heater & Refactor
add missing code
desiderata
* update honeywell client library & CODEOWNER
add auth_tokens code, refactor & delint
refactor for broker
* bugfix - loc_idx may not be 0
more refactor - ensure pure async
more refactoring
appears all r/o attributes are working
tweak precsion, DHW & delint
remove unused code
remove unused code 2
remove unused code, refactor _save_auth_tokens()
* support RoundThermostat
bugfix opmode, switch to util.dt, add until=1h
revert breaking change
* store at_expires as naive UTC
remove debug code
delint
tidy up exception handling
delint
add water_heater, add storage - initial commit
delint
add missing code
desiderata
update honeywell client library & CODEOWNER
add auth_tokens code, refactor & delint
refactor for broker
add water_heater, add storage - initial commit
delint
add missing code
desiderata
update honeywell client library & CODEOWNER
add auth_tokens code, refactor & delint
refactor for broker
delint
bugfix - loc_idx may not be 0
more refactor - ensure pure async
more refactoring
appears all r/o attributes are working
tweak precsion, DHW & delint
remove unused code
remove unused code 2
remove unused code, refactor _save_auth_tokens()
support RoundThermostat
bugfix opmode, switch to util.dt, add until=1h
revert breaking change
store at_expires as naive UTC
remove debug code
delint
tidy up exception handling
delint
* update CODEOWNERS
* fix regression
* fix requirements
* migrate to climate-1.0
* tweaking
* de-lint
* TCS working? & delint
* tweaking
* TCS code finalised
* remove available() logic
* refactor _switchpoints()
* tidy up switchpoint code
* tweak
* teaking device_state_attributes
* some refactoring
* move PRESET_CUSTOM back to evohome
* move CONF_ACCESS_TOKEN_EXPIRES CONF_REFRESH_TOKEN back to evohome
* refactor SP code and dt conversion
* delinted
* delinted
* remove water_heater
* fix regression
* Migrate homekit
* Cleanup away mode
* Fix tests
* add helpers
* fix tests melissa
* Fix nehueat
* fix zwave
* add more tests
* fix deconz
* Fix climate test emulate_hue
* fix tests
* fix dyson tests
* fix demo with new layout
* fix honeywell
* Switch homekit_controller to use HVAC_MODE_HEAT_COOL instead of HVAC_MODE_AUTO (#25009)
* Lint
* PyLint
* Pylint
* fix fritzbox tests
* Fix google
* Fix all tests
* Fix lint
* Fix auto for homekit like controler
* Fix lint
* fix lint
2019-07-08 12:00:24 +00:00
|
|
|
self.device.tmode = TEMP_MODE_TO_CODE[hvac_mode]
|
2017-11-22 20:59:49 +00:00
|
|
|
# Setting t_cool or t_heat automatically changes tmode.
|
2022-04-26 07:05:15 +00:00
|
|
|
elif hvac_mode == HVACMode.COOL:
|
2022-06-05 23:59:52 +00:00
|
|
|
self.device.t_cool = self.target_temperature
|
2022-04-26 07:05:15 +00:00
|
|
|
elif hvac_mode == HVACMode.HEAT:
|
2022-06-05 23:59:52 +00:00
|
|
|
self.device.t_heat = self.target_temperature
|
2020-01-09 14:25:19 +00:00
|
|
|
|
2022-06-05 23:59:52 +00:00
|
|
|
async def async_set_preset_mode(self, preset_mode: str) -> None:
|
2020-01-09 14:25:19 +00:00
|
|
|
"""Set Preset mode (Home, Alternate, Away, Holiday)."""
|
2022-06-05 23:59:52 +00:00
|
|
|
if preset_mode not in PRESET_MODES:
|
2022-06-08 00:26:06 +00:00
|
|
|
raise ValueError(f"{preset_mode} is not a valid preset_mode")
|
2022-06-05 23:59:52 +00:00
|
|
|
await self.hass.async_add_executor_job(self._set_preset_mode, preset_mode)
|
|
|
|
self._attr_preset_mode = preset_mode
|
|
|
|
self.async_write_ha_state()
|
|
|
|
await self.coordinator.async_request_refresh()
|
|
|
|
|
|
|
|
def _set_preset_mode(self, preset_mode: str) -> None:
|
|
|
|
"""Set Preset mode (Home, Alternate, Away, Holiday)."""
|
2022-06-08 00:26:06 +00:00
|
|
|
assert isinstance(self.device, radiotherm.thermostat.CT80)
|
2022-06-05 23:59:52 +00:00
|
|
|
self.device.program_mode = PRESET_MODE_TO_CODE[preset_mode]
|