-
Notifications
You must be signed in to change notification settings - Fork 1
/
const.py
164 lines (152 loc) · 6.06 KB
/
const.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
"""The electrolux Status constants."""
from homeassistant.const import UnitOfTime
from homeassistant.const import UnitOfTemperature
from homeassistant.const import UnitOfPower
from homeassistant.const import PERCENTAGE
from homeassistant.components.sensor import SensorDeviceClass
from homeassistant.components.binary_sensor import BinarySensorDeviceClass
from homeassistant.helpers.entity import EntityCategory
# Base component constants
NAME = "Elettrolux status"
DOMAIN = "electrolux_status"
DOMAIN_DATA = f"{DOMAIN}_data"
# Icons
ICON = "mdi:format-quote-close"
# Device classes
BINARY_SENSOR_DEVICE_CLASS = "connectivity"
# Platforms
BINARY_SENSOR = "binary_sensor"
SENSOR = "sensor"
BUTTON = "button"
PLATFORMS = [BINARY_SENSOR, SENSOR, BUTTON]
# Configuration and options
CONF_ENABLED = "enabled"
CONF_USERNAME = "username"
CONF_PASSWORD = "password"
CONF_LANGUAGE = "language"
CONF_SCAN_INTERVAL = "scan_interval"
# Defaults
DEFAULT_NAME = DOMAIN
DEFAULT_SCAN_INTERVAL = 30
DEFAULT_LANGUAGE = "English"
# capabilities model :
#
# key = "entry" or "category/entry"
# {
# access = "read" or "readwrite" or "write" (other values ignored)
# type = "boolean" or "string" or "number" (other values ignored including "int" type only used in maintenance section)
# => problem to differentiate classic numbers to time : check after "time" string in key name ? or temperature
# values (optional)= list of available values
# min / max / step for type = number
# }
sensors = {
# Sensor Name: [value field, device class, unit]
# Device state sensors
None: {
"timeToEnd": [None, None, UnitOfTime.MINUTES],
"runningTime": [None, None, UnitOfTime.MINUTES],
"cyclePhase": [None, None, None],
"cycleSubPhase": ["string", None, None],
"applianceState": [None, None, None],
"displayTemperature": ["container", SensorDeviceClass.TEMPERATURE, UnitOfTemperature.CELSIUS],
"displayFoodProbeTemperature": ["container", SensorDeviceClass.TEMPERATURE, UnitOfTemperature.CELSIUS],
"sensorTemperature": ["container", SensorDeviceClass.TEMPERATURE, UnitOfTemperature.CELSIUS],
"defrostTemperature": ["container", SensorDeviceClass.TEMPERATURE, UnitOfTemperature.CELSIUS],
"targetMicrowavePower": ["numberValue", SensorDeviceClass.ENERGY, UnitOfPower.WATT],
"ovenProcessIdentifier": ["valueTransl", None, None],
"remoteControl": [None, None, None],
"defaultExtraRinse": ["numberValue", None, None],
"targetTemperature": ["container", SensorDeviceClass.TEMPERATURE, UnitOfTemperature.CELSIUS],
"startTime": [None, None, UnitOfTime.MINUTES],
"analogTemperature": ["numberValue", SensorDeviceClass.TEMPERATURE, UnitOfTemperature.CELSIUS],
"waterSoftenerMode": [None, None, None],
"steamValue": ["valTransl", None, None],
"eLUXTimeManagerLevel": ["valTransl", None, None],
"analogSpinSpeed": ["valTransl", None, None],
"waterTankWarningMode": [None, None, None],
"dryingTime": [None, None, None],
"humidityTarget": ["valTransl", None, None],
"antiCreaseValue": [None, None, None],
"drynessValue": ["valTransl", None, None],
"programUID": ["valTransl", None, None]
},
# Device diagnostic sensors
EntityCategory.DIAGNOSTIC : {
"sensorHumidity": ["numberValue", SensorDeviceClass.HUMIDITY, PERCENTAGE, None],
"ambientTemperature": ["container", SensorDeviceClass.TEMPERATURE, UnitOfTemperature.CELSIUS, None],
"applianceTotalWorkingTime": [None, None, UnitOfTime.MINUTES],
"totalCycleCounter": [None, None, None],
"rinseAidLevel": [None, None, None],
"waterHardness": ["valueTransl", None, None],
"fCTotalWashCyclesCount": [None, None, None],
"fCTotalWashingTime": [None, None, None],
"applianceMode": [None, None, None],
}
}
sensors_binary = {
# Sensor Name: [value field, device class, invert]
# Device state sensors
None: {
"doorState": ["numberValue", BinarySensorDeviceClass.DOOR, None],
"doorLock": ["numberValue", BinarySensorDeviceClass.LOCK, True],
"uiLockMode": ["numberValue", None, None],
"endOfCycleSound": ["numberValue", None, None],
"defaultSoftPlus": ["numberValue", None, None],
"preWashPhase": ["numberValue", None, None],
"rinseHold": ["numberValue", None, None],
"nightCycle": ["numberValue", None, None],
"stain": ["numberValue", None, None],
"wMEconomy": ["numberValue", None, None],
"anticreaseWSteam": ["numberValue", None, None],
"anticreaseNoSteam": ["numberValue", None, None],
"refresh": ["numberValue", None, None],
"reversePlus": ["numberValue", None, None],
"delicate": ["numberValue", None, None],
"tDEnergyLabel": ["numberValue", None, None],
"tDEconomy_Eco": ["numberValue", None, None],
"tDEconomy_Night": ["numberValue", None, None],
},
# Device diagnostic sensors
EntityCategory.DIAGNOSTIC : {
"tankA_reserve": ["numberValue", BinarySensorDeviceClass.PROBLEM, False],
"tankB_reserve": ["numberValue", BinarySensorDeviceClass.PROBLEM, False],
}
}
icon_mapping = {
"OFF": "mdi:power-off",
"ON": "mdi:power-on",
"START": "mdi:play",
"STOPRESET": "mdi:stop",
"PAUSE": "mdi:pause",
"RESUME": "mdi:play-pause",
}
# List of supported Mobile App languages (from https://emea-production.api.electrolux.net/masterdata-service/api/v1/languages)
languages = {
"български": "bul",
"český": "ces",
"Dansk": "dan",
"Deutsch": "deu",
"ελληνικός": "ell",
"English": "eng",
"eesti": "est",
"Soome": "fin",
"Français": "fra",
"Hrvatski": "hrv",
"magyar": "hun",
"Italiano": "ita",
"lettone": "lav",
"lituano": "lit",
"Luxembourgish": "ltz",
"nederlands": "nld",
"Norsk": "nor",
"Polski": "pol",
"Português": "por",
"Română": "ron",
"rusesc": "rus",
"slovenský": "slk",
"slovinský": "slv",
"Español": "spa",
"Svenska": "swe",
"Türk": "tur",
"Ukrayna": "ukr",
}