2019-02-14 15:01:46 +00:00
|
|
|
"""Support for Homekit climate devices."""
|
2022-02-01 19:30:37 +00:00
|
|
|
from __future__ import annotations
|
|
|
|
|
2018-06-25 13:45:26 +00:00
|
|
|
import logging
|
2022-02-03 16:18:03 +00:00
|
|
|
from typing import Any, Final
|
2018-06-25 13:45:26 +00:00
|
|
|
|
2020-03-18 15:12:55 +00:00
|
|
|
from aiohomekit.model.characteristics import (
|
2020-08-25 16:56:01 +00:00
|
|
|
ActivationStateValues,
|
2020-03-18 15:12:55 +00:00
|
|
|
CharacteristicsTypes,
|
2020-08-25 16:56:01 +00:00
|
|
|
CurrentHeaterCoolerStateValues,
|
2020-03-18 15:12:55 +00:00
|
|
|
HeatingCoolingCurrentValues,
|
|
|
|
HeatingCoolingTargetValues,
|
2020-08-25 16:56:01 +00:00
|
|
|
SwingModeValues,
|
|
|
|
TargetHeaterCoolerStateValues,
|
2020-03-18 15:12:55 +00:00
|
|
|
)
|
2022-02-01 19:30:37 +00:00
|
|
|
from aiohomekit.model.services import Service, ServicesTypes
|
2020-03-18 15:12:55 +00:00
|
|
|
from aiohomekit.utils import clamp_enum_to_char
|
2019-08-14 16:14:15 +00:00
|
|
|
|
2022-02-03 16:18:03 +00:00
|
|
|
from homeassistant.components.climate import (
|
2021-06-29 09:14:28 +00:00
|
|
|
ATTR_HVAC_MODE,
|
2020-12-06 23:23:08 +00:00
|
|
|
ATTR_TARGET_TEMP_HIGH,
|
|
|
|
ATTR_TARGET_TEMP_LOW,
|
2022-09-10 21:39:52 +00:00
|
|
|
DEFAULT_MAX_TEMP,
|
|
|
|
DEFAULT_MIN_TEMP,
|
2022-07-05 14:25:30 +00:00
|
|
|
FAN_AUTO,
|
|
|
|
FAN_ON,
|
2020-08-25 16:56:01 +00:00
|
|
|
SWING_OFF,
|
|
|
|
SWING_VERTICAL,
|
2022-09-10 21:39:52 +00:00
|
|
|
ClimateEntity,
|
2022-04-26 04:27:58 +00:00
|
|
|
ClimateEntityFeature,
|
|
|
|
HVACAction,
|
|
|
|
HVACMode,
|
2019-07-31 19:25:30 +00:00
|
|
|
)
|
2021-12-28 18:24:40 +00:00
|
|
|
from homeassistant.config_entries import ConfigEntry
|
2022-10-11 21:26:03 +00:00
|
|
|
from homeassistant.const import ATTR_TEMPERATURE, TEMP_CELSIUS, Platform
|
2021-12-28 18:24:40 +00:00
|
|
|
from homeassistant.core import HomeAssistant, callback
|
|
|
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
2019-03-21 05:56:46 +00:00
|
|
|
|
2022-08-06 18:10:26 +00:00
|
|
|
from . import KNOWN_DEVICES
|
2022-10-11 21:26:03 +00:00
|
|
|
from .connection import HKDevice
|
2022-08-06 18:10:26 +00:00
|
|
|
from .entity import HomeKitEntity
|
2018-06-25 13:45:26 +00:00
|
|
|
|
|
|
|
_LOGGER = logging.getLogger(__name__)
|
|
|
|
|
|
|
|
# Map of Homekit operation modes to hass modes
|
|
|
|
MODE_HOMEKIT_TO_HASS = {
|
2022-04-26 04:27:58 +00:00
|
|
|
HeatingCoolingTargetValues.OFF: HVACMode.OFF,
|
|
|
|
HeatingCoolingTargetValues.HEAT: HVACMode.HEAT,
|
|
|
|
HeatingCoolingTargetValues.COOL: HVACMode.COOL,
|
|
|
|
HeatingCoolingTargetValues.AUTO: HVACMode.HEAT_COOL,
|
2018-06-25 13:45:26 +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
|
|
|
CURRENT_MODE_HOMEKIT_TO_HASS = {
|
2022-04-26 04:27:58 +00:00
|
|
|
HeatingCoolingCurrentValues.IDLE: HVACAction.IDLE,
|
|
|
|
HeatingCoolingCurrentValues.HEATING: HVACAction.HEATING,
|
|
|
|
HeatingCoolingCurrentValues.COOLING: HVACAction.COOLING,
|
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
|
|
|
}
|
|
|
|
|
2020-08-25 16:56:01 +00:00
|
|
|
SWING_MODE_HOMEKIT_TO_HASS = {
|
|
|
|
SwingModeValues.DISABLED: SWING_OFF,
|
|
|
|
SwingModeValues.ENABLED: SWING_VERTICAL,
|
|
|
|
}
|
|
|
|
|
|
|
|
CURRENT_HEATER_COOLER_STATE_HOMEKIT_TO_HASS = {
|
2022-04-26 04:27:58 +00:00
|
|
|
CurrentHeaterCoolerStateValues.INACTIVE: HVACAction.OFF,
|
|
|
|
CurrentHeaterCoolerStateValues.IDLE: HVACAction.IDLE,
|
|
|
|
CurrentHeaterCoolerStateValues.HEATING: HVACAction.HEATING,
|
|
|
|
CurrentHeaterCoolerStateValues.COOLING: HVACAction.COOLING,
|
2020-08-25 16:56:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
TARGET_HEATER_COOLER_STATE_HOMEKIT_TO_HASS = {
|
2022-04-26 04:27:58 +00:00
|
|
|
TargetHeaterCoolerStateValues.AUTOMATIC: HVACMode.HEAT_COOL,
|
|
|
|
TargetHeaterCoolerStateValues.HEAT: HVACMode.HEAT,
|
|
|
|
TargetHeaterCoolerStateValues.COOL: HVACMode.COOL,
|
2020-08-25 16:56:01 +00:00
|
|
|
}
|
|
|
|
|
2022-07-05 14:25:30 +00:00
|
|
|
|
2020-08-25 16:56:01 +00:00
|
|
|
# Map of hass operation modes to homekit modes
|
|
|
|
MODE_HASS_TO_HOMEKIT = {v: k for k, v in MODE_HOMEKIT_TO_HASS.items()}
|
|
|
|
|
|
|
|
TARGET_HEATER_COOLER_STATE_HASS_TO_HOMEKIT = {
|
|
|
|
v: k for k, v in TARGET_HEATER_COOLER_STATE_HOMEKIT_TO_HASS.items()
|
|
|
|
}
|
|
|
|
|
|
|
|
SWING_MODE_HASS_TO_HOMEKIT = {v: k for k, v in SWING_MODE_HOMEKIT_TO_HASS.items()}
|
|
|
|
|
2022-02-03 16:18:03 +00:00
|
|
|
DEFAULT_MIN_STEP: Final = 1.0
|
|
|
|
|
2018-06-25 13:45:26 +00:00
|
|
|
|
2021-12-28 18:24:40 +00:00
|
|
|
async def async_setup_entry(
|
|
|
|
hass: HomeAssistant,
|
|
|
|
config_entry: ConfigEntry,
|
|
|
|
async_add_entities: AddEntitiesCallback,
|
|
|
|
) -> None:
|
2018-06-25 13:45:26 +00:00
|
|
|
"""Set up Homekit climate."""
|
2022-10-11 21:26:03 +00:00
|
|
|
hkid: str = config_entry.data["AccessoryPairingID"]
|
|
|
|
conn: HKDevice = hass.data[KNOWN_DEVICES][hkid]
|
2019-05-13 06:56:05 +00:00
|
|
|
|
2020-01-29 21:59:45 +00:00
|
|
|
@callback
|
2022-02-01 19:30:37 +00:00
|
|
|
def async_add_service(service: Service) -> bool:
|
2022-01-31 22:48:16 +00:00
|
|
|
if not (entity_class := ENTITY_TYPES.get(service.type)):
|
2019-05-13 06:56:05 +00:00
|
|
|
return False
|
2020-11-16 23:11:39 +00:00
|
|
|
info = {"aid": service.accessory.aid, "iid": service.iid}
|
2022-10-11 21:26:03 +00:00
|
|
|
entity: HomeKitEntity = entity_class(conn, info)
|
|
|
|
conn.async_migrate_unique_id(
|
|
|
|
entity.old_unique_id, entity.unique_id, Platform.CLIMATE
|
|
|
|
)
|
|
|
|
async_add_entities([entity])
|
2019-05-13 06:56:05 +00:00
|
|
|
return True
|
|
|
|
|
|
|
|
conn.add_listener(async_add_service)
|
2018-06-25 13:45:26 +00:00
|
|
|
|
|
|
|
|
2022-07-05 14:25:30 +00:00
|
|
|
class HomeKitBaseClimateEntity(HomeKitEntity, ClimateEntity):
|
|
|
|
"""The base HomeKit Controller climate entity."""
|
|
|
|
|
|
|
|
_attr_temperature_unit = TEMP_CELSIUS
|
2020-08-25 16:56:01 +00:00
|
|
|
|
2022-02-01 19:30:37 +00:00
|
|
|
def get_characteristic_types(self) -> list[str]:
|
2020-08-25 16:56:01 +00:00
|
|
|
"""Define the homekit characteristics the entity cares about."""
|
|
|
|
return [
|
2022-07-05 14:25:30 +00:00
|
|
|
CharacteristicsTypes.TEMPERATURE_CURRENT,
|
|
|
|
CharacteristicsTypes.FAN_STATE_TARGET,
|
|
|
|
]
|
|
|
|
|
|
|
|
@property
|
|
|
|
def current_temperature(self) -> float | None:
|
|
|
|
"""Return the current temperature."""
|
|
|
|
return self.service.value(CharacteristicsTypes.TEMPERATURE_CURRENT)
|
|
|
|
|
|
|
|
@property
|
|
|
|
def fan_modes(self) -> list[str] | None:
|
|
|
|
"""Return the available fan modes."""
|
|
|
|
if self.service.has(CharacteristicsTypes.FAN_STATE_TARGET):
|
|
|
|
return [FAN_ON, FAN_AUTO]
|
|
|
|
return None
|
|
|
|
|
|
|
|
@property
|
|
|
|
def fan_mode(self) -> str | None:
|
|
|
|
"""Return the current fan mode."""
|
|
|
|
fan_mode = self.service.value(CharacteristicsTypes.FAN_STATE_TARGET)
|
|
|
|
return FAN_AUTO if fan_mode else FAN_ON
|
|
|
|
|
|
|
|
async def async_set_fan_mode(self, fan_mode: str) -> None:
|
|
|
|
"""Turn fan to manual/auto."""
|
|
|
|
await self.async_put_characteristics(
|
|
|
|
{CharacteristicsTypes.FAN_STATE_TARGET: int(fan_mode == FAN_AUTO)}
|
|
|
|
)
|
|
|
|
|
|
|
|
@property
|
|
|
|
def supported_features(self) -> int:
|
|
|
|
"""Return the list of supported features."""
|
|
|
|
features = 0
|
|
|
|
|
|
|
|
if self.service.has(CharacteristicsTypes.FAN_STATE_TARGET):
|
|
|
|
features |= ClimateEntityFeature.FAN_MODE
|
|
|
|
|
|
|
|
return features
|
|
|
|
|
|
|
|
|
|
|
|
class HomeKitHeaterCoolerEntity(HomeKitBaseClimateEntity):
|
|
|
|
"""Representation of a Homekit climate device."""
|
|
|
|
|
|
|
|
def get_characteristic_types(self) -> list[str]:
|
|
|
|
"""Define the homekit characteristics the entity cares about."""
|
|
|
|
return super().get_characteristic_types() + [
|
2020-08-25 16:56:01 +00:00
|
|
|
CharacteristicsTypes.ACTIVE,
|
|
|
|
CharacteristicsTypes.CURRENT_HEATER_COOLER_STATE,
|
|
|
|
CharacteristicsTypes.TARGET_HEATER_COOLER_STATE,
|
|
|
|
CharacteristicsTypes.TEMPERATURE_COOLING_THRESHOLD,
|
|
|
|
CharacteristicsTypes.TEMPERATURE_HEATING_THRESHOLD,
|
|
|
|
CharacteristicsTypes.SWING_MODE,
|
|
|
|
]
|
|
|
|
|
2022-02-01 19:30:37 +00:00
|
|
|
async def async_set_temperature(self, **kwargs: Any) -> None:
|
2020-08-25 16:56:01 +00:00
|
|
|
"""Set new target temperature."""
|
|
|
|
temp = kwargs.get(ATTR_TEMPERATURE)
|
|
|
|
state = self.service.value(CharacteristicsTypes.TARGET_HEATER_COOLER_STATE)
|
|
|
|
if state == TargetHeaterCoolerStateValues.COOL:
|
|
|
|
await self.async_put_characteristics(
|
|
|
|
{CharacteristicsTypes.TEMPERATURE_COOLING_THRESHOLD: temp}
|
|
|
|
)
|
|
|
|
elif state == TargetHeaterCoolerStateValues.HEAT:
|
|
|
|
await self.async_put_characteristics(
|
|
|
|
{CharacteristicsTypes.TEMPERATURE_HEATING_THRESHOLD: temp}
|
|
|
|
)
|
|
|
|
else:
|
|
|
|
hvac_mode = TARGET_HEATER_COOLER_STATE_HOMEKIT_TO_HASS.get(state)
|
|
|
|
_LOGGER.warning(
|
2021-03-19 14:26:36 +00:00
|
|
|
"HomeKit device %s: Setting temperature in %s mode is not supported yet;"
|
|
|
|
" Consider raising a ticket if you have this device and want to help us implement this feature",
|
2020-08-25 16:56:01 +00:00
|
|
|
self.entity_id,
|
|
|
|
hvac_mode,
|
|
|
|
)
|
|
|
|
|
2022-04-26 04:27:58 +00:00
|
|
|
async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None:
|
2020-08-25 16:56:01 +00:00
|
|
|
"""Set new target operation mode."""
|
2022-04-26 04:27:58 +00:00
|
|
|
if hvac_mode == HVACMode.OFF:
|
2020-08-25 16:56:01 +00:00
|
|
|
await self.async_put_characteristics(
|
|
|
|
{CharacteristicsTypes.ACTIVE: ActivationStateValues.INACTIVE}
|
|
|
|
)
|
|
|
|
return
|
2022-04-26 04:27:58 +00:00
|
|
|
if hvac_mode not in {HVACMode.HEAT, HVACMode.COOL}:
|
2020-08-25 16:56:01 +00:00
|
|
|
_LOGGER.warning(
|
2021-03-19 14:26:36 +00:00
|
|
|
"HomeKit device %s: Setting temperature in %s mode is not supported yet;"
|
|
|
|
" Consider raising a ticket if you have this device and want to help us implement this feature",
|
2020-08-25 16:56:01 +00:00
|
|
|
self.entity_id,
|
|
|
|
hvac_mode,
|
|
|
|
)
|
|
|
|
await self.async_put_characteristics(
|
|
|
|
{
|
|
|
|
CharacteristicsTypes.TARGET_HEATER_COOLER_STATE: TARGET_HEATER_COOLER_STATE_HASS_TO_HOMEKIT[
|
|
|
|
hvac_mode
|
|
|
|
],
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
@property
|
2022-02-01 19:30:37 +00:00
|
|
|
def target_temperature(self) -> float | None:
|
2020-08-25 16:56:01 +00:00
|
|
|
"""Return the temperature we try to reach."""
|
|
|
|
state = self.service.value(CharacteristicsTypes.TARGET_HEATER_COOLER_STATE)
|
|
|
|
if state == TargetHeaterCoolerStateValues.COOL:
|
|
|
|
return self.service.value(
|
|
|
|
CharacteristicsTypes.TEMPERATURE_COOLING_THRESHOLD
|
|
|
|
)
|
|
|
|
if state == TargetHeaterCoolerStateValues.HEAT:
|
|
|
|
return self.service.value(
|
|
|
|
CharacteristicsTypes.TEMPERATURE_HEATING_THRESHOLD
|
|
|
|
)
|
|
|
|
return None
|
|
|
|
|
|
|
|
@property
|
2022-02-03 16:18:03 +00:00
|
|
|
def target_temperature_step(self) -> float:
|
2020-08-25 16:56:01 +00:00
|
|
|
"""Return the supported step of target temperature."""
|
|
|
|
state = self.service.value(CharacteristicsTypes.TARGET_HEATER_COOLER_STATE)
|
|
|
|
if state == TargetHeaterCoolerStateValues.COOL and self.service.has(
|
|
|
|
CharacteristicsTypes.TEMPERATURE_COOLING_THRESHOLD
|
|
|
|
):
|
2022-02-03 16:18:03 +00:00
|
|
|
return (
|
|
|
|
self.service[CharacteristicsTypes.TEMPERATURE_COOLING_THRESHOLD].minStep
|
|
|
|
or DEFAULT_MIN_STEP
|
|
|
|
)
|
2020-08-25 16:56:01 +00:00
|
|
|
if state == TargetHeaterCoolerStateValues.HEAT and self.service.has(
|
|
|
|
CharacteristicsTypes.TEMPERATURE_HEATING_THRESHOLD
|
|
|
|
):
|
2022-02-03 16:18:03 +00:00
|
|
|
return (
|
|
|
|
self.service[CharacteristicsTypes.TEMPERATURE_HEATING_THRESHOLD].minStep
|
|
|
|
or DEFAULT_MIN_STEP
|
|
|
|
)
|
|
|
|
return DEFAULT_MIN_STEP
|
2020-08-25 16:56:01 +00:00
|
|
|
|
|
|
|
@property
|
2022-02-01 19:30:37 +00:00
|
|
|
def min_temp(self) -> float:
|
2020-08-25 16:56:01 +00:00
|
|
|
"""Return the minimum target temp."""
|
|
|
|
state = self.service.value(CharacteristicsTypes.TARGET_HEATER_COOLER_STATE)
|
|
|
|
if state == TargetHeaterCoolerStateValues.COOL and self.service.has(
|
|
|
|
CharacteristicsTypes.TEMPERATURE_COOLING_THRESHOLD
|
|
|
|
):
|
2022-02-03 16:18:03 +00:00
|
|
|
return (
|
|
|
|
self.service[
|
|
|
|
CharacteristicsTypes.TEMPERATURE_COOLING_THRESHOLD
|
|
|
|
].minValue
|
|
|
|
or DEFAULT_MIN_TEMP
|
|
|
|
)
|
2020-08-25 16:56:01 +00:00
|
|
|
if state == TargetHeaterCoolerStateValues.HEAT and self.service.has(
|
|
|
|
CharacteristicsTypes.TEMPERATURE_HEATING_THRESHOLD
|
|
|
|
):
|
2022-02-03 16:18:03 +00:00
|
|
|
return (
|
|
|
|
self.service[
|
|
|
|
CharacteristicsTypes.TEMPERATURE_HEATING_THRESHOLD
|
|
|
|
].minValue
|
|
|
|
or DEFAULT_MIN_TEMP
|
|
|
|
)
|
2020-08-25 16:56:01 +00:00
|
|
|
return super().min_temp
|
|
|
|
|
|
|
|
@property
|
2022-02-01 19:30:37 +00:00
|
|
|
def max_temp(self) -> float:
|
2020-08-25 16:56:01 +00:00
|
|
|
"""Return the maximum target temp."""
|
|
|
|
state = self.service.value(CharacteristicsTypes.TARGET_HEATER_COOLER_STATE)
|
|
|
|
if state == TargetHeaterCoolerStateValues.COOL and self.service.has(
|
|
|
|
CharacteristicsTypes.TEMPERATURE_COOLING_THRESHOLD
|
|
|
|
):
|
2022-02-03 16:18:03 +00:00
|
|
|
return (
|
|
|
|
self.service[
|
|
|
|
CharacteristicsTypes.TEMPERATURE_COOLING_THRESHOLD
|
|
|
|
].maxValue
|
|
|
|
or DEFAULT_MAX_TEMP
|
|
|
|
)
|
2020-08-25 16:56:01 +00:00
|
|
|
if state == TargetHeaterCoolerStateValues.HEAT and self.service.has(
|
|
|
|
CharacteristicsTypes.TEMPERATURE_HEATING_THRESHOLD
|
|
|
|
):
|
2022-02-03 16:18:03 +00:00
|
|
|
return (
|
|
|
|
self.service[
|
|
|
|
CharacteristicsTypes.TEMPERATURE_HEATING_THRESHOLD
|
|
|
|
].maxValue
|
|
|
|
or DEFAULT_MAX_TEMP
|
|
|
|
)
|
2020-08-25 16:56:01 +00:00
|
|
|
return super().max_temp
|
|
|
|
|
|
|
|
@property
|
2022-04-26 04:27:58 +00:00
|
|
|
def hvac_action(self) -> HVACAction | None:
|
2020-08-25 16:56:01 +00:00
|
|
|
"""Return the current running hvac operation."""
|
|
|
|
# This characteristic describes the current mode of a device,
|
|
|
|
# e.g. a thermostat is "heating" a room to 75 degrees Fahrenheit.
|
|
|
|
# Can be 0 - 3 (Off, Idle, Heat, Cool)
|
|
|
|
if (
|
|
|
|
self.service.value(CharacteristicsTypes.ACTIVE)
|
|
|
|
== ActivationStateValues.INACTIVE
|
|
|
|
):
|
2022-04-26 04:27:58 +00:00
|
|
|
return HVACAction.OFF
|
2020-08-25 16:56:01 +00:00
|
|
|
value = self.service.value(CharacteristicsTypes.CURRENT_HEATER_COOLER_STATE)
|
|
|
|
return CURRENT_HEATER_COOLER_STATE_HOMEKIT_TO_HASS.get(value)
|
|
|
|
|
|
|
|
@property
|
2022-04-26 04:27:58 +00:00
|
|
|
def hvac_mode(self) -> HVACMode:
|
2020-08-25 16:56:01 +00:00
|
|
|
"""Return hvac operation ie. heat, cool mode."""
|
|
|
|
# This characteristic describes the target mode
|
|
|
|
# E.g. should the device start heating a room if the temperature
|
|
|
|
# falls below the target temperature.
|
|
|
|
# Can be 0 - 2 (Auto, Heat, Cool)
|
|
|
|
if (
|
|
|
|
self.service.value(CharacteristicsTypes.ACTIVE)
|
|
|
|
== ActivationStateValues.INACTIVE
|
|
|
|
):
|
2022-04-26 04:27:58 +00:00
|
|
|
return HVACMode.OFF
|
2020-08-25 16:56:01 +00:00
|
|
|
value = self.service.value(CharacteristicsTypes.TARGET_HEATER_COOLER_STATE)
|
2022-02-01 19:30:37 +00:00
|
|
|
return TARGET_HEATER_COOLER_STATE_HOMEKIT_TO_HASS[value]
|
2020-08-25 16:56:01 +00:00
|
|
|
|
|
|
|
@property
|
2022-04-26 04:27:58 +00:00
|
|
|
def hvac_modes(self) -> list[HVACMode]:
|
2020-08-25 16:56:01 +00:00
|
|
|
"""Return the list of available hvac operation modes."""
|
|
|
|
valid_values = clamp_enum_to_char(
|
|
|
|
TargetHeaterCoolerStateValues,
|
|
|
|
self.service[CharacteristicsTypes.TARGET_HEATER_COOLER_STATE],
|
|
|
|
)
|
|
|
|
modes = [
|
|
|
|
TARGET_HEATER_COOLER_STATE_HOMEKIT_TO_HASS[mode] for mode in valid_values
|
|
|
|
]
|
2022-04-26 04:27:58 +00:00
|
|
|
modes.append(HVACMode.OFF)
|
2020-08-25 16:56:01 +00:00
|
|
|
return modes
|
|
|
|
|
|
|
|
@property
|
2022-02-01 19:30:37 +00:00
|
|
|
def swing_mode(self) -> str:
|
2020-08-25 16:56:01 +00:00
|
|
|
"""Return the swing setting.
|
|
|
|
|
2022-04-06 10:04:58 +00:00
|
|
|
Requires ClimateEntityFeature.SWING_MODE.
|
2020-08-25 16:56:01 +00:00
|
|
|
"""
|
|
|
|
value = self.service.value(CharacteristicsTypes.SWING_MODE)
|
|
|
|
return SWING_MODE_HOMEKIT_TO_HASS[value]
|
|
|
|
|
|
|
|
@property
|
2022-02-01 19:30:37 +00:00
|
|
|
def swing_modes(self) -> list[str]:
|
2020-08-25 16:56:01 +00:00
|
|
|
"""Return the list of available swing modes.
|
|
|
|
|
2022-04-06 10:04:58 +00:00
|
|
|
Requires ClimateEntityFeature.SWING_MODE.
|
2020-08-25 16:56:01 +00:00
|
|
|
"""
|
|
|
|
valid_values = clamp_enum_to_char(
|
2020-08-27 11:56:20 +00:00
|
|
|
SwingModeValues,
|
|
|
|
self.service[CharacteristicsTypes.SWING_MODE],
|
2020-08-25 16:56:01 +00:00
|
|
|
)
|
|
|
|
return [SWING_MODE_HOMEKIT_TO_HASS[mode] for mode in valid_values]
|
|
|
|
|
|
|
|
async def async_set_swing_mode(self, swing_mode: str) -> None:
|
|
|
|
"""Set new target swing operation."""
|
|
|
|
await self.async_put_characteristics(
|
|
|
|
{CharacteristicsTypes.SWING_MODE: SWING_MODE_HASS_TO_HOMEKIT[swing_mode]}
|
|
|
|
)
|
|
|
|
|
|
|
|
@property
|
2022-02-01 19:30:37 +00:00
|
|
|
def supported_features(self) -> int:
|
2020-08-25 16:56:01 +00:00
|
|
|
"""Return the list of supported features."""
|
2022-07-05 14:25:30 +00:00
|
|
|
features = super().supported_features
|
2020-08-25 16:56:01 +00:00
|
|
|
|
|
|
|
if self.service.has(CharacteristicsTypes.TEMPERATURE_COOLING_THRESHOLD):
|
2022-04-06 10:04:58 +00:00
|
|
|
features |= ClimateEntityFeature.TARGET_TEMPERATURE
|
2020-08-25 16:56:01 +00:00
|
|
|
|
|
|
|
if self.service.has(CharacteristicsTypes.TEMPERATURE_HEATING_THRESHOLD):
|
2022-04-06 10:04:58 +00:00
|
|
|
features |= ClimateEntityFeature.TARGET_TEMPERATURE
|
2020-08-25 16:56:01 +00:00
|
|
|
|
|
|
|
if self.service.has(CharacteristicsTypes.SWING_MODE):
|
2022-04-06 10:04:58 +00:00
|
|
|
features |= ClimateEntityFeature.SWING_MODE
|
2020-08-25 16:56:01 +00:00
|
|
|
|
|
|
|
return features
|
|
|
|
|
|
|
|
|
2022-07-05 14:25:30 +00:00
|
|
|
class HomeKitClimateEntity(HomeKitBaseClimateEntity):
|
2018-06-25 13:45:26 +00:00
|
|
|
"""Representation of a Homekit climate device."""
|
|
|
|
|
2022-02-01 19:30:37 +00:00
|
|
|
def get_characteristic_types(self) -> list[str]:
|
2019-01-28 16:21:20 +00:00
|
|
|
"""Define the homekit characteristics the entity cares about."""
|
2022-07-05 14:25:30 +00:00
|
|
|
return super().get_characteristic_types() + [
|
2019-01-28 16:21:20 +00:00
|
|
|
CharacteristicsTypes.HEATING_COOLING_CURRENT,
|
|
|
|
CharacteristicsTypes.HEATING_COOLING_TARGET,
|
2020-12-06 23:23:08 +00:00
|
|
|
CharacteristicsTypes.TEMPERATURE_COOLING_THRESHOLD,
|
|
|
|
CharacteristicsTypes.TEMPERATURE_HEATING_THRESHOLD,
|
2019-01-28 16:21:20 +00:00
|
|
|
CharacteristicsTypes.TEMPERATURE_TARGET,
|
2019-04-17 17:03:32 +00:00
|
|
|
CharacteristicsTypes.RELATIVE_HUMIDITY_CURRENT,
|
|
|
|
CharacteristicsTypes.RELATIVE_HUMIDITY_TARGET,
|
2019-01-28 16:21:20 +00:00
|
|
|
]
|
|
|
|
|
2022-02-03 16:18:03 +00:00
|
|
|
async def async_set_temperature(self, **kwargs: Any) -> None:
|
2018-06-25 13:45:26 +00:00
|
|
|
"""Set new target temperature."""
|
2022-02-03 16:18:03 +00:00
|
|
|
chars: dict[str, Any] = {}
|
2021-06-29 09:14:28 +00:00
|
|
|
|
|
|
|
value = self.service.value(CharacteristicsTypes.HEATING_COOLING_TARGET)
|
2022-02-01 19:30:37 +00:00
|
|
|
mode = MODE_HOMEKIT_TO_HASS[value]
|
2021-06-29 09:14:28 +00:00
|
|
|
|
|
|
|
if kwargs.get(ATTR_HVAC_MODE, mode) != mode:
|
|
|
|
mode = kwargs[ATTR_HVAC_MODE]
|
|
|
|
chars[CharacteristicsTypes.HEATING_COOLING_TARGET] = MODE_HASS_TO_HOMEKIT[
|
|
|
|
mode
|
|
|
|
]
|
|
|
|
|
2018-06-25 13:45:26 +00:00
|
|
|
temp = kwargs.get(ATTR_TEMPERATURE)
|
2020-12-06 23:23:08 +00:00
|
|
|
heat_temp = kwargs.get(ATTR_TARGET_TEMP_LOW)
|
|
|
|
cool_temp = kwargs.get(ATTR_TARGET_TEMP_HIGH)
|
2021-06-29 09:14:28 +00:00
|
|
|
|
2022-02-01 19:30:37 +00:00
|
|
|
if (
|
2022-04-26 04:27:58 +00:00
|
|
|
(mode == HVACMode.HEAT_COOL)
|
2022-04-06 10:04:58 +00:00
|
|
|
and (
|
|
|
|
ClimateEntityFeature.TARGET_TEMPERATURE_RANGE & self.supported_features
|
|
|
|
)
|
2022-02-01 19:30:37 +00:00
|
|
|
and heat_temp
|
|
|
|
and cool_temp
|
2021-01-13 14:21:32 +00:00
|
|
|
):
|
2020-12-06 23:23:08 +00:00
|
|
|
if temp is None:
|
|
|
|
temp = (cool_temp + heat_temp) / 2
|
2021-06-29 09:14:28 +00:00
|
|
|
chars.update(
|
2020-12-06 23:23:08 +00:00
|
|
|
{
|
|
|
|
CharacteristicsTypes.TEMPERATURE_HEATING_THRESHOLD: heat_temp,
|
|
|
|
CharacteristicsTypes.TEMPERATURE_COOLING_THRESHOLD: cool_temp,
|
|
|
|
CharacteristicsTypes.TEMPERATURE_TARGET: temp,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
else:
|
2021-06-29 09:14:28 +00:00
|
|
|
chars[CharacteristicsTypes.TEMPERATURE_TARGET] = temp
|
|
|
|
|
|
|
|
await self.async_put_characteristics(chars)
|
2018-06-25 13:45:26 +00:00
|
|
|
|
2022-02-01 19:30:37 +00:00
|
|
|
async def async_set_humidity(self, humidity: int) -> None:
|
2019-04-17 17:03:32 +00:00
|
|
|
"""Set new target humidity."""
|
2020-03-11 16:27:20 +00:00
|
|
|
await self.async_put_characteristics(
|
|
|
|
{CharacteristicsTypes.RELATIVE_HUMIDITY_TARGET: humidity}
|
|
|
|
)
|
2019-04-17 17:03:32 +00:00
|
|
|
|
2022-04-26 04:27:58 +00:00
|
|
|
async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None:
|
2018-06-25 13:45:26 +00:00
|
|
|
"""Set new target operation mode."""
|
2020-03-11 16:27:20 +00:00
|
|
|
await self.async_put_characteristics(
|
2019-07-31 19:25:30 +00:00
|
|
|
{
|
2020-03-11 16:27:20 +00:00
|
|
|
CharacteristicsTypes.HEATING_COOLING_TARGET: MODE_HASS_TO_HOMEKIT[
|
|
|
|
hvac_mode
|
|
|
|
],
|
2019-07-31 19:25:30 +00:00
|
|
|
}
|
2020-03-11 16:27:20 +00:00
|
|
|
)
|
2018-06-25 13:45:26 +00:00
|
|
|
|
|
|
|
@property
|
2022-02-01 19:30:37 +00:00
|
|
|
def target_temperature(self) -> float | None:
|
2018-06-25 13:45:26 +00:00
|
|
|
"""Return the temperature we try to reach."""
|
2020-12-06 23:23:08 +00:00
|
|
|
value = self.service.value(CharacteristicsTypes.HEATING_COOLING_TARGET)
|
2022-04-26 04:27:58 +00:00
|
|
|
if (MODE_HOMEKIT_TO_HASS.get(value) in {HVACMode.HEAT, HVACMode.COOL}) or (
|
|
|
|
(MODE_HOMEKIT_TO_HASS.get(value) in {HVACMode.HEAT_COOL})
|
2022-04-06 10:04:58 +00:00
|
|
|
and not (
|
|
|
|
ClimateEntityFeature.TARGET_TEMPERATURE_RANGE & self.supported_features
|
|
|
|
)
|
2021-01-13 14:21:32 +00:00
|
|
|
):
|
|
|
|
return self.service.value(CharacteristicsTypes.TEMPERATURE_TARGET)
|
|
|
|
return None
|
2018-06-25 13:45:26 +00:00
|
|
|
|
2020-12-06 23:23:08 +00:00
|
|
|
@property
|
2022-02-01 19:30:37 +00:00
|
|
|
def target_temperature_high(self) -> float | None:
|
2020-12-06 23:23:08 +00:00
|
|
|
"""Return the highbound target temperature we try to reach."""
|
|
|
|
value = self.service.value(CharacteristicsTypes.HEATING_COOLING_TARGET)
|
2022-04-26 04:27:58 +00:00
|
|
|
if (MODE_HOMEKIT_TO_HASS.get(value) in {HVACMode.HEAT_COOL}) and (
|
2022-04-06 10:04:58 +00:00
|
|
|
ClimateEntityFeature.TARGET_TEMPERATURE_RANGE & self.supported_features
|
2021-01-13 14:21:32 +00:00
|
|
|
):
|
|
|
|
return self.service.value(
|
|
|
|
CharacteristicsTypes.TEMPERATURE_COOLING_THRESHOLD
|
|
|
|
)
|
|
|
|
return None
|
2020-12-06 23:23:08 +00:00
|
|
|
|
|
|
|
@property
|
2022-02-01 19:30:37 +00:00
|
|
|
def target_temperature_low(self) -> float | None:
|
2020-12-06 23:23:08 +00:00
|
|
|
"""Return the lowbound target temperature we try to reach."""
|
|
|
|
value = self.service.value(CharacteristicsTypes.HEATING_COOLING_TARGET)
|
2022-04-26 04:27:58 +00:00
|
|
|
if (MODE_HOMEKIT_TO_HASS.get(value) in {HVACMode.HEAT_COOL}) and (
|
2022-04-06 10:04:58 +00:00
|
|
|
ClimateEntityFeature.TARGET_TEMPERATURE_RANGE & self.supported_features
|
2021-01-13 14:21:32 +00:00
|
|
|
):
|
|
|
|
return self.service.value(
|
|
|
|
CharacteristicsTypes.TEMPERATURE_HEATING_THRESHOLD
|
|
|
|
)
|
|
|
|
return None
|
2020-12-06 23:23:08 +00:00
|
|
|
|
2019-04-30 22:08:31 +00:00
|
|
|
@property
|
2022-02-01 19:30:37 +00:00
|
|
|
def min_temp(self) -> float:
|
2019-04-30 22:08:31 +00:00
|
|
|
"""Return the minimum target temp."""
|
2020-12-06 23:23:08 +00:00
|
|
|
value = self.service.value(CharacteristicsTypes.HEATING_COOLING_TARGET)
|
2022-04-26 04:27:58 +00:00
|
|
|
if (MODE_HOMEKIT_TO_HASS.get(value) in {HVACMode.HEAT_COOL}) and (
|
2022-04-06 10:04:58 +00:00
|
|
|
ClimateEntityFeature.TARGET_TEMPERATURE_RANGE & self.supported_features
|
2021-01-13 14:21:32 +00:00
|
|
|
):
|
2020-12-06 23:23:08 +00:00
|
|
|
min_temp = self.service[
|
|
|
|
CharacteristicsTypes.TEMPERATURE_HEATING_THRESHOLD
|
|
|
|
].minValue
|
|
|
|
if min_temp is not None:
|
|
|
|
return min_temp
|
2021-01-13 14:21:32 +00:00
|
|
|
elif MODE_HOMEKIT_TO_HASS.get(value) in {
|
2022-04-26 04:27:58 +00:00
|
|
|
HVACMode.HEAT,
|
|
|
|
HVACMode.COOL,
|
|
|
|
HVACMode.HEAT_COOL,
|
2021-01-13 14:21:32 +00:00
|
|
|
}:
|
2020-12-06 23:23:08 +00:00
|
|
|
min_temp = self.service[CharacteristicsTypes.TEMPERATURE_TARGET].minValue
|
|
|
|
if min_temp is not None:
|
|
|
|
return min_temp
|
2019-04-30 22:08:31 +00:00
|
|
|
return super().min_temp
|
|
|
|
|
|
|
|
@property
|
2022-02-01 19:30:37 +00:00
|
|
|
def max_temp(self) -> float:
|
2019-04-30 22:08:31 +00:00
|
|
|
"""Return the maximum target temp."""
|
2020-12-06 23:23:08 +00:00
|
|
|
value = self.service.value(CharacteristicsTypes.HEATING_COOLING_TARGET)
|
2022-04-26 04:27:58 +00:00
|
|
|
if (MODE_HOMEKIT_TO_HASS.get(value) in {HVACMode.HEAT_COOL}) and (
|
2022-04-06 10:04:58 +00:00
|
|
|
ClimateEntityFeature.TARGET_TEMPERATURE_RANGE & self.supported_features
|
2021-01-13 14:21:32 +00:00
|
|
|
):
|
2020-12-06 23:23:08 +00:00
|
|
|
max_temp = self.service[
|
|
|
|
CharacteristicsTypes.TEMPERATURE_COOLING_THRESHOLD
|
|
|
|
].maxValue
|
|
|
|
if max_temp is not None:
|
|
|
|
return max_temp
|
2021-01-13 14:21:32 +00:00
|
|
|
elif MODE_HOMEKIT_TO_HASS.get(value) in {
|
2022-04-26 04:27:58 +00:00
|
|
|
HVACMode.HEAT,
|
|
|
|
HVACMode.COOL,
|
|
|
|
HVACMode.HEAT_COOL,
|
2021-01-13 14:21:32 +00:00
|
|
|
}:
|
2020-12-06 23:23:08 +00:00
|
|
|
max_temp = self.service[CharacteristicsTypes.TEMPERATURE_TARGET].maxValue
|
|
|
|
if max_temp is not None:
|
|
|
|
return max_temp
|
2019-04-30 22:08:31 +00:00
|
|
|
return super().max_temp
|
|
|
|
|
2019-04-17 17:03:32 +00:00
|
|
|
@property
|
2022-02-01 19:30:37 +00:00
|
|
|
def current_humidity(self) -> int:
|
2019-04-17 17:03:32 +00:00
|
|
|
"""Return the current humidity."""
|
2020-03-11 11:40:47 +00:00
|
|
|
return self.service.value(CharacteristicsTypes.RELATIVE_HUMIDITY_CURRENT)
|
2019-04-17 17:03:32 +00:00
|
|
|
|
|
|
|
@property
|
2022-02-01 19:30:37 +00:00
|
|
|
def target_humidity(self) -> int:
|
2019-04-17 17:03:32 +00:00
|
|
|
"""Return the humidity we try to reach."""
|
2020-03-11 11:40:47 +00:00
|
|
|
return self.service.value(CharacteristicsTypes.RELATIVE_HUMIDITY_TARGET)
|
2019-04-17 17:03:32 +00:00
|
|
|
|
2019-04-30 22:08:31 +00:00
|
|
|
@property
|
2022-02-01 19:30:37 +00:00
|
|
|
def min_humidity(self) -> int:
|
2019-04-30 22:08:31 +00:00
|
|
|
"""Return the minimum humidity."""
|
2021-10-27 08:02:07 +00:00
|
|
|
min_humidity = self.service[
|
|
|
|
CharacteristicsTypes.RELATIVE_HUMIDITY_TARGET
|
|
|
|
].minValue
|
|
|
|
if min_humidity is not None:
|
2022-02-03 16:18:03 +00:00
|
|
|
return int(min_humidity)
|
2021-10-27 08:02:07 +00:00
|
|
|
return super().min_humidity
|
2019-04-30 22:08:31 +00:00
|
|
|
|
|
|
|
@property
|
2022-02-01 19:30:37 +00:00
|
|
|
def max_humidity(self) -> int:
|
2019-04-30 22:08:31 +00:00
|
|
|
"""Return the maximum humidity."""
|
2021-10-27 08:02:07 +00:00
|
|
|
max_humidity = self.service[
|
|
|
|
CharacteristicsTypes.RELATIVE_HUMIDITY_TARGET
|
|
|
|
].maxValue
|
|
|
|
if max_humidity is not None:
|
2022-02-03 16:18:03 +00:00
|
|
|
return int(max_humidity)
|
2021-10-27 08:02:07 +00:00
|
|
|
return super().max_humidity
|
2019-04-30 22:08:31 +00:00
|
|
|
|
2018-06-25 13:45:26 +00:00
|
|
|
@property
|
2022-04-26 04:27:58 +00:00
|
|
|
def hvac_action(self) -> HVACAction | None:
|
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
|
|
|
"""Return the current running hvac operation."""
|
2020-03-11 11:40:47 +00:00
|
|
|
# This characteristic describes the current mode of a device,
|
|
|
|
# e.g. a thermostat is "heating" a room to 75 degrees Fahrenheit.
|
|
|
|
# Can be 0 - 2 (Off, Heat, Cool)
|
2022-10-10 18:58:20 +00:00
|
|
|
|
|
|
|
# If the HVAC is switched off, it must be idle
|
|
|
|
# This works around a bug in some devices (like Eve radiator valves) that
|
|
|
|
# return they are heating when they are not.
|
|
|
|
target = self.service.value(CharacteristicsTypes.HEATING_COOLING_TARGET)
|
|
|
|
if target == HeatingCoolingTargetValues.OFF:
|
|
|
|
return HVACAction.IDLE
|
|
|
|
|
2020-03-11 11:40:47 +00:00
|
|
|
value = self.service.value(CharacteristicsTypes.HEATING_COOLING_CURRENT)
|
|
|
|
return CURRENT_MODE_HOMEKIT_TO_HASS.get(value)
|
2018-06-25 13:45:26 +00:00
|
|
|
|
|
|
|
@property
|
2022-04-26 04:27:58 +00:00
|
|
|
def hvac_mode(self) -> HVACMode:
|
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
|
|
|
"""Return hvac operation ie. heat, cool mode."""
|
2020-03-11 11:40:47 +00:00
|
|
|
# This characteristic describes the target mode
|
|
|
|
# E.g. should the device start heating a room if the temperature
|
|
|
|
# falls below the target temperature.
|
|
|
|
# Can be 0 - 3 (Off, Heat, Cool, Auto)
|
|
|
|
value = self.service.value(CharacteristicsTypes.HEATING_COOLING_TARGET)
|
2022-02-01 19:30:37 +00:00
|
|
|
return MODE_HOMEKIT_TO_HASS[value]
|
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
|
|
|
|
|
|
|
@property
|
2022-04-26 04:27:58 +00:00
|
|
|
def hvac_modes(self) -> list[HVACMode]:
|
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
|
|
|
"""Return the list of available hvac operation modes."""
|
2020-03-18 15:12:55 +00:00
|
|
|
valid_values = clamp_enum_to_char(
|
|
|
|
HeatingCoolingTargetValues,
|
|
|
|
self.service[CharacteristicsTypes.HEATING_COOLING_TARGET],
|
|
|
|
)
|
|
|
|
return [MODE_HOMEKIT_TO_HASS[mode] for mode in valid_values]
|
2018-06-25 13:45:26 +00:00
|
|
|
|
|
|
|
@property
|
2022-02-01 19:30:37 +00:00
|
|
|
def supported_features(self) -> int:
|
2018-06-25 13:45:26 +00:00
|
|
|
"""Return the list of supported features."""
|
2022-07-05 14:25:30 +00:00
|
|
|
features = super().supported_features
|
2020-03-18 15:12:55 +00:00
|
|
|
|
|
|
|
if self.service.has(CharacteristicsTypes.TEMPERATURE_TARGET):
|
2022-04-06 10:04:58 +00:00
|
|
|
features |= ClimateEntityFeature.TARGET_TEMPERATURE
|
2020-03-18 15:12:55 +00:00
|
|
|
|
2020-12-06 23:23:08 +00:00
|
|
|
if self.service.has(
|
|
|
|
CharacteristicsTypes.TEMPERATURE_COOLING_THRESHOLD
|
|
|
|
) and self.service.has(CharacteristicsTypes.TEMPERATURE_HEATING_THRESHOLD):
|
2022-04-06 10:04:58 +00:00
|
|
|
features |= ClimateEntityFeature.TARGET_TEMPERATURE_RANGE
|
2020-12-06 23:23:08 +00:00
|
|
|
|
2020-03-18 15:12:55 +00:00
|
|
|
if self.service.has(CharacteristicsTypes.RELATIVE_HUMIDITY_TARGET):
|
2022-04-06 10:04:58 +00:00
|
|
|
features |= ClimateEntityFeature.TARGET_HUMIDITY
|
2020-03-18 15:12:55 +00:00
|
|
|
|
|
|
|
return features
|
2018-06-25 13:45:26 +00:00
|
|
|
|
2020-08-25 16:56:01 +00:00
|
|
|
|
|
|
|
ENTITY_TYPES = {
|
2020-11-16 23:11:39 +00:00
|
|
|
ServicesTypes.HEATER_COOLER: HomeKitHeaterCoolerEntity,
|
|
|
|
ServicesTypes.THERMOSTAT: HomeKitClimateEntity,
|
2020-08-25 16:56:01 +00:00
|
|
|
}
|