* Update PyVicare to 2.x With PyViCare 2.8.1 a breaking change was introduced which required changes on sensor and binary_sensor platforms: - Circuit, Burner and Compressor have been separated out from the "main" device - Multiple circuits and burners allow "duplicate sensors". We add the circuit or burner number as suffix now At the same time the sensors are now created only when available: During entity creation we can check if the value is provided for the user's device. Sensors are not created by heating type anymore but instead the new API structure is reflected, providing device, burner or circuit sensors. For details of breaking changes from PyViCare 1.x to 2.x please see https://github.com/somm15/PyViCare#breaking-changes-in-version-2x * Integrate review comments * variables cleanup * Update unique ids The unique ids shall not depend on the name but on the entity description key (which should not change) and the id of the circuit, burner or device.
40 lines
863 B
Python
40 lines
863 B
Python
"""Constants for the ViCare integration."""
|
|
import enum
|
|
|
|
DOMAIN = "vicare"
|
|
|
|
PLATFORMS = ["climate", "sensor", "binary_sensor", "water_heater"]
|
|
|
|
VICARE_DEVICE_CONFIG = "device_conf"
|
|
VICARE_API = "api"
|
|
VICARE_NAME = "name"
|
|
VICARE_CIRCUITS = "circuits"
|
|
|
|
CONF_CIRCUIT = "circuit"
|
|
CONF_HEATING_TYPE = "heating_type"
|
|
|
|
DEFAULT_SCAN_INTERVAL = 60
|
|
|
|
|
|
class HeatingType(enum.Enum):
|
|
"""Possible options for heating type."""
|
|
|
|
auto = "auto"
|
|
gas = "gas"
|
|
oil = "oil"
|
|
pellets = "pellets"
|
|
heatpump = "heatpump"
|
|
fuelcell = "fuelcell"
|
|
|
|
|
|
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",
|
|
}
|