hass-core/homeassistant/components/vicare/const.py
Christopher Fenner f764705629
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 16:23:27 +02:00

67 lines
1.4 KiB
Python

"""Constants for the ViCare integration."""
import enum
from homeassistant.const import Platform
DOMAIN = "vicare"
PLATFORMS = [
Platform.BINARY_SENSOR,
Platform.BUTTON,
Platform.CLIMATE,
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",
]
DEVICE_LIST = "device_list"
VICARE_NAME = "ViCare"
CONF_CIRCUIT = "circuit"
CONF_HEATING_TYPE = "heating_type"
DEFAULT_CACHE_DURATION = 60
VICARE_PERCENT = "percent"
VICARE_W = "watt"
VICARE_KW = "kilowatt"
VICARE_WH = "wattHour"
VICARE_KWH = "kilowattHour"
VICARE_CUBIC_METER = "cubicMeter"
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",
}