mirror of
https://github.com/home-assistant/core
synced 2024-08-28 03:36:46 +02:00
![Christopher Fenner](/assets/img/avatar_default.png)
* add number entity * use static constraints * use async execute job * add number platform * Update .coveragerc * remove unused code parts * add types * add missing return type * Apply suggestions from code review Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com> * Apply suggestions from code review Co-authored-by: Jan-Philipp Benecke <github@bnck.me> * fix docstrings * fix variable names * add unit of measurement * remove obsolete unique id handling * remove hass from constructor * inline _entities_from_descriptions function * fix return type * rename variable * Apply suggestions from code review Co-authored-by: Jan-Philipp Benecke <github@bnck.me> * Apply suggestions from code review --------- Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com> Co-authored-by: Jan-Philipp Benecke <github@bnck.me>
60 lines
1.3 KiB
Python
60 lines
1.3 KiB
Python
"""Constants for the ViCare integration."""
|
|
import enum
|
|
|
|
from homeassistant.const import Platform, UnitOfEnergy, UnitOfVolume
|
|
|
|
DOMAIN = "vicare"
|
|
|
|
PLATFORMS = [
|
|
Platform.BINARY_SENSOR,
|
|
Platform.BUTTON,
|
|
Platform.CLIMATE,
|
|
Platform.NUMBER,
|
|
Platform.SENSOR,
|
|
Platform.WATER_HEATER,
|
|
]
|
|
|
|
VICARE_DEVICE_CONFIG = "device_conf"
|
|
VICARE_DEVICE_CONFIG_LIST = "device_config_list"
|
|
VICARE_API = "api"
|
|
VICARE_NAME = "ViCare"
|
|
|
|
CONF_CIRCUIT = "circuit"
|
|
CONF_HEATING_TYPE = "heating_type"
|
|
|
|
DEFAULT_SCAN_INTERVAL = 60
|
|
|
|
VICARE_CUBIC_METER = "cubicMeter"
|
|
VICARE_KWH = "kilowattHour"
|
|
|
|
|
|
VICARE_UNIT_TO_UNIT_OF_MEASUREMENT = {
|
|
VICARE_KWH: UnitOfEnergy.KILO_WATT_HOUR,
|
|
VICARE_CUBIC_METER: UnitOfVolume.CUBIC_METERS,
|
|
}
|
|
|
|
|
|
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",
|
|
}
|