core/homeassistant/components/vicare/const.py

68 lines
1.4 KiB
Python
Raw Normal View History

"""Constants for the ViCare integration."""
import enum
from homeassistant.const import Platform
2021-10-27 19:15:54 +00:00
DOMAIN = "vicare"
PLATFORMS = [
Platform.BINARY_SENSOR,
Platform.BUTTON,
Platform.CLIMATE,
Add support for ventilation device to ViCare (#114175) * add ventilation program & mode * add ventilation device * Update climate.py * Update climate.py * Update climate.py * Update climate.py * Update climate.py * Update const.py * Create fan.py * Update fan.py * Update types.py * add test case * add translation key * use translation key * update snapshot * fix ruff findings * fix ruff findings * add log messages to setter * adjust test case * reset climate entity * do not display speed if not in permanent mode * update snapshot * update test cases * add comment * mark fan as always on * prevent turning off device * allow to set permanent mode * make speed_count static * add debug outputs * add preset state translations * allow permanent mode * update snapshot * add test case * load programs only on init * comment on ventilation modes * adjust test cases * add exception message * ignore test coverage on fan.py * Update test_fan.py * simplify * Apply suggestions from code review * remove tests * remove extra state attributes * fix leftover * add missing labels * adjust label * change state keys * use _attr_preset_modes * fix ruff findings * fix attribute access * fix from_ha_mode * fix ruff findings * fix mypy findings * simplify * format * fix typo * fix ruff finding * Apply suggestions from code review * change fan mode handling * add test cases * remove turn_off * Apply suggestions from code review Co-authored-by: Erik Montnemery <erik@montnemery.com> * Apply suggestions from code review * Update fan.py --------- Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-07-31 14:23:27 +00:00
Platform.FAN,
Platform.NUMBER,
Platform.SENSOR,
Platform.WATER_HEATER,
]
UNSUPPORTED_DEVICES = [
"Heatbox1",
"Heatbox2_SRC",
"E3_TCU41_x04",
"E3_FloorHeatingCircuitChannel",
"E3_FloorHeatingCircuitDistributorBox",
"E3_RoomControl_One_522",
"E3_RoomSensor",
]
Add support for multiple devices linked to a Viessmann account (#96044) * care about all devices * use first device for diagnostics * update constants * handle multiple devices * handle multiple devices * handle multiple devices * handle multiple devices * handle multiple devices * code style * code style * code style * code style * code style * remove unused import * remove unused import * use has_entity_name and add serial to device name * use has_entity_name and add serial to device name * use has_entity_name and add serial to device name * use has_entity_name and add serial to device name * use has_entity_name and add serial to device name * remove unused constant * Update const.py * Update binary_sensor.py * change format * change format * fix line duplication * fix line duplication * change format * fix typo * use serial in device name if multiple devices are found * add common base class * use base class * Update __init__.py * Update __init__.py * Update __init__.py * Update sensor.py * Update binary_sensor.py * correct import * use base class * fix cdestyle findings * fix pylint findings * fix mypy findings * fix codestyle finidings * move has_entity_name to base class * Revert "fix mypy findings" This reverts commit 2d78801a69ec13670e0ef47354daf54b383eb595. * fix type issue * move multiple device handling * fix import * remove special handling for device name * extract api getter * Update __init__.py * Update __init__.py * Update entity.py * Update button.py * Update binary_sensor.py * Update climate.py * Update sensor.py * Update water_heater.py * Apply suggestions from code review Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com> * Update __init__.py * fix mypy & black * move get_device to utils * rename const * Apply suggestions from code review Co-authored-by: Robert Resch <robert@resch.dev> * store device in config entry * extract types * fix diagnostics * handle new platform * handle api rate limit * add types * add types * rename * add types * ignore gateways for now * Update .coveragerc * adjust types * fix merge issues * rename * Update types.py * fix type * add test method * simplify * ignore unused devices * Apply suggestions from code review Co-authored-by: Robert Resch <robert@resch.dev> * fix findings * handle unsupported devices * Apply suggestions from code review Co-authored-by: Robert Resch <robert@resch.dev> * Update types.py * fix format * adjust variable naming * Update conftest.py * Update conftest.py * remove kw_only * Apply suggestions from code review * Update __init__.py * Update binary_sensor.py * Update button.py * Update climate.py * Update const.py * Update diagnostics.py * Update number.py * Update sensor.py * Update types.py * Update water_heater.py * fix comment * Apply suggestions from code review Co-authored-by: Erik Montnemery <erik@montnemery.com> --------- Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com> Co-authored-by: Robert Resch <robert@resch.dev> Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-02-15 12:58:00 +00:00
DEVICE_LIST = "device_list"
VICARE_NAME = "ViCare"
CONF_CIRCUIT = "circuit"
CONF_HEATING_TYPE = "heating_type"
Add support for multiple devices linked to a Viessmann account (#96044) * care about all devices * use first device for diagnostics * update constants * handle multiple devices * handle multiple devices * handle multiple devices * handle multiple devices * handle multiple devices * code style * code style * code style * code style * code style * remove unused import * remove unused import * use has_entity_name and add serial to device name * use has_entity_name and add serial to device name * use has_entity_name and add serial to device name * use has_entity_name and add serial to device name * use has_entity_name and add serial to device name * remove unused constant * Update const.py * Update binary_sensor.py * change format * change format * fix line duplication * fix line duplication * change format * fix typo * use serial in device name if multiple devices are found * add common base class * use base class * Update __init__.py * Update __init__.py * Update __init__.py * Update sensor.py * Update binary_sensor.py * correct import * use base class * fix cdestyle findings * fix pylint findings * fix mypy findings * fix codestyle finidings * move has_entity_name to base class * Revert "fix mypy findings" This reverts commit 2d78801a69ec13670e0ef47354daf54b383eb595. * fix type issue * move multiple device handling * fix import * remove special handling for device name * extract api getter * Update __init__.py * Update __init__.py * Update entity.py * Update button.py * Update binary_sensor.py * Update climate.py * Update sensor.py * Update water_heater.py * Apply suggestions from code review Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com> * Update __init__.py * fix mypy & black * move get_device to utils * rename const * Apply suggestions from code review Co-authored-by: Robert Resch <robert@resch.dev> * store device in config entry * extract types * fix diagnostics * handle new platform * handle api rate limit * add types * add types * rename * add types * ignore gateways for now * Update .coveragerc * adjust types * fix merge issues * rename * Update types.py * fix type * add test method * simplify * ignore unused devices * Apply suggestions from code review Co-authored-by: Robert Resch <robert@resch.dev> * fix findings * handle unsupported devices * Apply suggestions from code review Co-authored-by: Robert Resch <robert@resch.dev> * Update types.py * fix format * adjust variable naming * Update conftest.py * Update conftest.py * remove kw_only * Apply suggestions from code review * Update __init__.py * Update binary_sensor.py * Update button.py * Update climate.py * Update const.py * Update diagnostics.py * Update number.py * Update sensor.py * Update types.py * Update water_heater.py * fix comment * Apply suggestions from code review Co-authored-by: Erik Montnemery <erik@montnemery.com> --------- Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com> Co-authored-by: Robert Resch <robert@resch.dev> Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-02-15 12:58:00 +00:00
DEFAULT_CACHE_DURATION = 60
VICARE_PERCENT = "percent"
VICARE_W = "watt"
VICARE_KW = "kilowatt"
VICARE_WH = "wattHour"
2021-10-27 19:15:54 +00:00
VICARE_KWH = "kilowattHour"
VICARE_CUBIC_METER = "cubicMeter"
2021-10-27 19:15:54 +00:00
class HeatingType(enum.Enum):
"""Possible options for heating type."""
auto = "auto"
gas = "gas"
oil = "oil"
pellets = "pellets"
heatpump = "heatpump"
fuelcell = "fuelcell"
hybrid = "hybrid"
DEFAULT_HEATING_TYPE = HeatingType.auto
HEATING_TYPE_TO_CREATOR_METHOD = {
HeatingType.auto: "asAutoDetectDevice",
HeatingType.gas: "asGazBoiler",
HeatingType.fuelcell: "asFuelCell",
HeatingType.heatpump: "asHeatPump",
HeatingType.oil: "asOilBoiler",
HeatingType.pellets: "asPelletsBoiler",
HeatingType.hybrid: "asHybridDevice",
}