zigpy 1.2.0__tar.gz → 1.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {zigpy-1.2.0/zigpy.egg-info → zigpy-1.2.2}/PKG-INFO +1 -1
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/ota/__init__.py +15 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/quirks/v2/homeassistant/__init__.py +85 -9
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/quirks/v2/homeassistant/binary_sensor.py +2 -2
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/quirks/v2/homeassistant/number.py +91 -32
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/quirks/v2/homeassistant/sensor.py +86 -36
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/zcl/clusters/general.py +1 -1
- {zigpy-1.2.0 → zigpy-1.2.2/zigpy.egg-info}/PKG-INFO +1 -1
- {zigpy-1.2.0 → zigpy-1.2.2}/COPYING +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/LICENSE +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/README.md +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/pyproject.toml +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/setup.cfg +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/setup.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/tests/test_app_state.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/tests/test_appdb.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/tests/test_appdb_migration.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/tests/test_application.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/tests/test_backups.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/tests/test_config.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/tests/test_datastructures.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/tests/test_datastructures_cpython.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/tests/test_device.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/tests/test_endpoint.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/tests/test_event.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/tests/test_group.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/tests/test_listeners.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/tests/test_packet_callbacks.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/tests/test_quirks.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/tests/test_quirks_registry.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/tests/test_quirks_v2.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/tests/test_serial.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/tests/test_struct.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/tests/test_topology.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/tests/test_types.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/tests/test_zcl.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/tests/test_zcl_clusters.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/tests/test_zcl_foundation.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/tests/test_zcl_helpers.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/tests/test_zdo.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/tests/test_zdo_types.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/tests/test_zigbee_util.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/tools/__init__.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/tools/regenerate_mypy_ignores.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/__init__.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/appdb.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/appdb_schemas/__init__.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/appdb_schemas/schema_v0.sql +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/appdb_schemas/schema_v1.sql +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/appdb_schemas/schema_v10.sql +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/appdb_schemas/schema_v11.sql +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/appdb_schemas/schema_v12.sql +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/appdb_schemas/schema_v13.sql +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/appdb_schemas/schema_v14.sql +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/appdb_schemas/schema_v15.sql +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/appdb_schemas/schema_v2.sql +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/appdb_schemas/schema_v3.sql +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/appdb_schemas/schema_v4.sql +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/appdb_schemas/schema_v5.sql +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/appdb_schemas/schema_v6.sql +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/appdb_schemas/schema_v7.sql +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/appdb_schemas/schema_v8.sql +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/appdb_schemas/schema_v9.sql +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/application.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/backports/__init__.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/backups.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/config/__init__.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/config/defaults.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/config/validators.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/const.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/datastructures.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/device.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/endpoint.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/event/__init__.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/event/event_base.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/exceptions.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/group.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/listeners.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/ota/image.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/ota/json_schemas.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/ota/manager.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/ota/providers.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/ota/validators.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/profiles/__init__.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/profiles/zgp.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/profiles/zha.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/profiles/zll.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/py.typed +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/quirks/__init__.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/quirks/registry.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/quirks/v2/__init__.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/serial.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/state.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/topology.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/types/__init__.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/types/basic.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/types/named.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/types/struct.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/typing.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/util.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/zcl/__init__.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/zcl/clusters/__init__.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/zcl/clusters/closures.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/zcl/clusters/general_const.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/zcl/clusters/greenpower.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/zcl/clusters/homeautomation.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/zcl/clusters/hvac.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/zcl/clusters/lighting.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/zcl/clusters/lightlink.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/zcl/clusters/manufacturer_specific.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/zcl/clusters/measurement.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/zcl/clusters/protocol.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/zcl/clusters/security.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/zcl/clusters/smartenergy.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/zcl/clusters/wwah.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/zcl/foundation.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/zcl/helpers.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/zdo/__init__.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/zdo/types.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/zgp/__init__.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy/zgp/types.py +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy.egg-info/SOURCES.txt +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy.egg-info/dependency_links.txt +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy.egg-info/requires.txt +0 -0
- {zigpy-1.2.0 → zigpy-1.2.2}/zigpy.egg-info/top_level.txt +0 -0
|
@@ -61,6 +61,21 @@ class OtaImageWithMetadata(t.BaseDataclassMixin):
|
|
|
61
61
|
metadata: zigpy.ota.providers.BaseOtaImageMetadata
|
|
62
62
|
firmware: BaseOTAImage | None
|
|
63
63
|
|
|
64
|
+
def __repr__(self) -> str:
|
|
65
|
+
if self.firmware is not None:
|
|
66
|
+
firmware_repr = (
|
|
67
|
+
f"<{type(self.firmware).__name__}: "
|
|
68
|
+
f"{self.firmware.header.image_size} bytes>"
|
|
69
|
+
)
|
|
70
|
+
else:
|
|
71
|
+
firmware_repr = "None"
|
|
72
|
+
|
|
73
|
+
return (
|
|
74
|
+
f"{type(self).__name__}("
|
|
75
|
+
f"metadata={self.metadata!r}, "
|
|
76
|
+
f"firmware={firmware_repr})"
|
|
77
|
+
)
|
|
78
|
+
|
|
64
79
|
@property
|
|
65
80
|
def version(self) -> int:
|
|
66
81
|
return self.metadata.file_version
|
|
@@ -23,34 +23,74 @@ class EntityPlatform(StrEnum):
|
|
|
23
23
|
SWITCH = "switch"
|
|
24
24
|
|
|
25
25
|
|
|
26
|
+
# #### UNITS OF MEASUREMENT ####
|
|
27
|
+
# Apparent power units
|
|
26
28
|
class UnitOfApparentPower(StrEnum):
|
|
27
29
|
"""Apparent power units."""
|
|
28
30
|
|
|
31
|
+
MILLIVOLT_AMPERE = "mVA"
|
|
29
32
|
VOLT_AMPERE = "VA"
|
|
33
|
+
KILO_VOLT_AMPERE = "kVA"
|
|
30
34
|
|
|
31
35
|
|
|
32
36
|
# Power units
|
|
33
37
|
class UnitOfPower(StrEnum):
|
|
34
38
|
"""Power units."""
|
|
35
39
|
|
|
40
|
+
MILLIWATT = "mW"
|
|
36
41
|
WATT = "W"
|
|
37
42
|
KILO_WATT = "kW"
|
|
43
|
+
MEGA_WATT = "MW"
|
|
44
|
+
GIGA_WATT = "GW"
|
|
45
|
+
TERA_WATT = "TW"
|
|
38
46
|
BTU_PER_HOUR = "BTU/h"
|
|
39
47
|
|
|
40
48
|
|
|
41
49
|
# Reactive power units
|
|
42
|
-
|
|
50
|
+
class UnitOfReactivePower(StrEnum):
|
|
51
|
+
"""Reactive power units."""
|
|
52
|
+
|
|
53
|
+
MILLIVOLT_AMPERE_REACTIVE = "mvar"
|
|
54
|
+
VOLT_AMPERE_REACTIVE = "var"
|
|
55
|
+
KILO_VOLT_AMPERE_REACTIVE = "kvar"
|
|
43
56
|
|
|
44
57
|
|
|
45
58
|
# Energy units
|
|
46
59
|
class UnitOfEnergy(StrEnum):
|
|
47
60
|
"""Energy units."""
|
|
48
61
|
|
|
62
|
+
JOULE = "J"
|
|
63
|
+
KILO_JOULE = "kJ"
|
|
64
|
+
MEGA_JOULE = "MJ"
|
|
49
65
|
GIGA_JOULE = "GJ"
|
|
66
|
+
MILLIWATT_HOUR = "mWh"
|
|
67
|
+
WATT_HOUR = "Wh"
|
|
50
68
|
KILO_WATT_HOUR = "kWh"
|
|
51
|
-
MEGA_JOULE = "MJ"
|
|
52
69
|
MEGA_WATT_HOUR = "MWh"
|
|
53
|
-
|
|
70
|
+
GIGA_WATT_HOUR = "GWh"
|
|
71
|
+
TERA_WATT_HOUR = "TWh"
|
|
72
|
+
CALORIE = "cal"
|
|
73
|
+
KILO_CALORIE = "kcal"
|
|
74
|
+
MEGA_CALORIE = "Mcal"
|
|
75
|
+
GIGA_CALORIE = "Gcal"
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
# Reactive energy units
|
|
79
|
+
class UnitOfReactiveEnergy(StrEnum):
|
|
80
|
+
"""Reactive energy units."""
|
|
81
|
+
|
|
82
|
+
VOLT_AMPERE_REACTIVE_HOUR = "varh"
|
|
83
|
+
KILO_VOLT_AMPERE_REACTIVE_HOUR = "kvarh"
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
# Energy Distance units
|
|
87
|
+
class UnitOfEnergyDistance(StrEnum):
|
|
88
|
+
"""Energy Distance units."""
|
|
89
|
+
|
|
90
|
+
KILO_WATT_HOUR_PER_100_KM = "kWh/100km"
|
|
91
|
+
WATT_HOUR_PER_KM = "Wh/km"
|
|
92
|
+
MILES_PER_KILO_WATT_HOUR = "mi/kWh"
|
|
93
|
+
KM_PER_KILO_WATT_HOUR = "km/kWh"
|
|
54
94
|
|
|
55
95
|
|
|
56
96
|
# Electric_current units
|
|
@@ -65,8 +105,11 @@ class UnitOfElectricCurrent(StrEnum):
|
|
|
65
105
|
class UnitOfElectricPotential(StrEnum):
|
|
66
106
|
"""Electric potential units."""
|
|
67
107
|
|
|
108
|
+
MICROVOLT = "μV"
|
|
68
109
|
MILLIVOLT = "mV"
|
|
69
110
|
VOLT = "V"
|
|
111
|
+
KILOVOLT = "kV"
|
|
112
|
+
MEGAVOLT = "MV"
|
|
70
113
|
|
|
71
114
|
|
|
72
115
|
# Degree units
|
|
@@ -114,6 +157,7 @@ class UnitOfLength(StrEnum):
|
|
|
114
157
|
FEET = "ft"
|
|
115
158
|
YARDS = "yd"
|
|
116
159
|
MILES = "mi"
|
|
160
|
+
NAUTICAL_MILES = "nmi"
|
|
117
161
|
|
|
118
162
|
|
|
119
163
|
# Frequency units
|
|
@@ -130,6 +174,7 @@ class UnitOfFrequency(StrEnum):
|
|
|
130
174
|
class UnitOfPressure(StrEnum):
|
|
131
175
|
"""Pressure units."""
|
|
132
176
|
|
|
177
|
+
MILLIPASCAL = "mPa"
|
|
133
178
|
PA = "Pa"
|
|
134
179
|
HPA = "hPa"
|
|
135
180
|
KPA = "kPa"
|
|
@@ -138,6 +183,7 @@ class UnitOfPressure(StrEnum):
|
|
|
138
183
|
MBAR = "mbar"
|
|
139
184
|
MMHG = "mmHg"
|
|
140
185
|
INHG = "inHg"
|
|
186
|
+
INH2O = "inH₂O"
|
|
141
187
|
PSI = "psi"
|
|
142
188
|
|
|
143
189
|
|
|
@@ -155,6 +201,7 @@ class UnitOfVolume(StrEnum):
|
|
|
155
201
|
|
|
156
202
|
CUBIC_FEET = "ft³"
|
|
157
203
|
CENTUM_CUBIC_FEET = "CCF"
|
|
204
|
+
MILLE_CUBIC_FEET = "MCF"
|
|
158
205
|
CUBIC_METERS = "m³"
|
|
159
206
|
LITERS = "L"
|
|
160
207
|
MILLILITERS = "mL"
|
|
@@ -173,13 +220,31 @@ class UnitOfVolumeFlowRate(StrEnum):
|
|
|
173
220
|
"""Volume flow rate units."""
|
|
174
221
|
|
|
175
222
|
CUBIC_METERS_PER_HOUR = "m³/h"
|
|
223
|
+
CUBIC_METERS_PER_MINUTE = "m³/min"
|
|
224
|
+
CUBIC_METERS_PER_SECOND = "m³/s"
|
|
176
225
|
CUBIC_FEET_PER_MINUTE = "ft³/min"
|
|
226
|
+
LITERS_PER_HOUR = "L/h"
|
|
177
227
|
LITERS_PER_MINUTE = "L/min"
|
|
228
|
+
LITERS_PER_SECOND = "L/s"
|
|
229
|
+
GALLONS_PER_HOUR = "gal/h"
|
|
178
230
|
GALLONS_PER_MINUTE = "gal/min"
|
|
231
|
+
GALLONS_PER_DAY = "gal/d"
|
|
232
|
+
MILLILITERS_PER_SECOND = "mL/s"
|
|
233
|
+
|
|
179
234
|
|
|
235
|
+
class UnitOfArea(StrEnum):
|
|
236
|
+
"""Area units."""
|
|
180
237
|
|
|
181
|
-
|
|
182
|
-
|
|
238
|
+
SQUARE_METERS = "m²"
|
|
239
|
+
SQUARE_CENTIMETERS = "cm²"
|
|
240
|
+
SQUARE_KILOMETERS = "km²"
|
|
241
|
+
SQUARE_MILLIMETERS = "mm²"
|
|
242
|
+
SQUARE_INCHES = "in²"
|
|
243
|
+
SQUARE_FEET = "ft²"
|
|
244
|
+
SQUARE_YARDS = "yd²"
|
|
245
|
+
SQUARE_MILES = "mi²"
|
|
246
|
+
ACRES = "ac"
|
|
247
|
+
HECTARES = "ha"
|
|
183
248
|
|
|
184
249
|
|
|
185
250
|
# Mass units
|
|
@@ -189,18 +254,17 @@ class UnitOfMass(StrEnum):
|
|
|
189
254
|
GRAMS = "g"
|
|
190
255
|
KILOGRAMS = "kg"
|
|
191
256
|
MILLIGRAMS = "mg"
|
|
192
|
-
MICROGRAMS = "
|
|
257
|
+
MICROGRAMS = "μg"
|
|
193
258
|
OUNCES = "oz"
|
|
194
259
|
POUNDS = "lb"
|
|
195
260
|
STONES = "st"
|
|
196
261
|
|
|
197
262
|
|
|
198
|
-
# Conductivity units
|
|
199
263
|
class UnitOfConductivity(StrEnum):
|
|
200
264
|
"""Conductivity units."""
|
|
201
265
|
|
|
202
266
|
SIEMENS_PER_CM = "S/cm"
|
|
203
|
-
MICROSIEMENS_PER_CM = "
|
|
267
|
+
MICROSIEMENS_PER_CM = "μS/cm"
|
|
204
268
|
MILLISIEMENS_PER_CM = "mS/cm"
|
|
205
269
|
|
|
206
270
|
|
|
@@ -263,23 +327,35 @@ class UnitOfPrecipitationDepth(StrEnum):
|
|
|
263
327
|
|
|
264
328
|
|
|
265
329
|
# Concentration units
|
|
266
|
-
|
|
330
|
+
CONCENTRATION_GRAMS_PER_CUBIC_METER: Final = "g/m³"
|
|
267
331
|
CONCENTRATION_MILLIGRAMS_PER_CUBIC_METER: Final = "mg/m³"
|
|
332
|
+
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER: Final = "μg/m³"
|
|
268
333
|
CONCENTRATION_MICROGRAMS_PER_CUBIC_FOOT: Final = "μg/ft³"
|
|
269
334
|
CONCENTRATION_PARTS_PER_CUBIC_METER: Final = "p/m³"
|
|
270
335
|
CONCENTRATION_PARTS_PER_MILLION: Final = "ppm"
|
|
271
336
|
CONCENTRATION_PARTS_PER_BILLION: Final = "ppb"
|
|
272
337
|
|
|
273
338
|
|
|
339
|
+
class UnitOfBloodGlucoseConcentration(StrEnum):
|
|
340
|
+
"""Blood glucose concentration units."""
|
|
341
|
+
|
|
342
|
+
MILLIGRAMS_PER_DECILITER = "mg/dL"
|
|
343
|
+
MILLIMOLE_PER_LITER = "mmol/L"
|
|
344
|
+
|
|
345
|
+
|
|
274
346
|
# Speed units
|
|
275
347
|
class UnitOfSpeed(StrEnum):
|
|
276
348
|
"""Speed units."""
|
|
277
349
|
|
|
350
|
+
BEAUFORT = "Beaufort"
|
|
278
351
|
FEET_PER_SECOND = "ft/s"
|
|
352
|
+
INCHES_PER_SECOND = "in/s"
|
|
353
|
+
METERS_PER_MINUTE = "m/min"
|
|
279
354
|
METERS_PER_SECOND = "m/s"
|
|
280
355
|
KILOMETERS_PER_HOUR = "km/h"
|
|
281
356
|
KNOTS = "kn"
|
|
282
357
|
MILES_PER_HOUR = "mph"
|
|
358
|
+
MILLIMETERS_PER_SECOND = "mm/s"
|
|
283
359
|
|
|
284
360
|
|
|
285
361
|
# Signal_strength units
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"""Homeassistant sensor platform quirks v2 supporting items."""
|
|
2
2
|
|
|
3
|
-
from enum import
|
|
3
|
+
from enum import StrEnum
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
class BinarySensorDeviceClass(
|
|
6
|
+
class BinarySensorDeviceClass(StrEnum):
|
|
7
7
|
"""Device class for binary sensors."""
|
|
8
8
|
|
|
9
9
|
# On means low, Off means normal
|
|
@@ -1,23 +1,30 @@
|
|
|
1
1
|
"""Homeassistant number platform quirks v2 supporting items."""
|
|
2
2
|
|
|
3
|
-
from enum import
|
|
3
|
+
from enum import StrEnum
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
class
|
|
6
|
+
class NumberMode(StrEnum):
|
|
7
|
+
"""Modes for number entities."""
|
|
8
|
+
|
|
9
|
+
AUTO = "auto"
|
|
10
|
+
BOX = "box"
|
|
11
|
+
SLIDER = "slider"
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class NumberDeviceClass(StrEnum):
|
|
7
15
|
"""Device class for numbers."""
|
|
8
16
|
|
|
9
17
|
# NumberDeviceClass should be aligned with SensorDeviceClass
|
|
18
|
+
ABSOLUTE_HUMIDITY = "absolute_humidity"
|
|
19
|
+
"""Absolute humidity.
|
|
10
20
|
|
|
11
|
-
|
|
12
|
-
"""Acceleration.
|
|
13
|
-
|
|
14
|
-
Unit of measurement: `G`, `m/s²`
|
|
21
|
+
Unit of measurement: `g/m³`, `mg/m³`
|
|
15
22
|
"""
|
|
16
23
|
|
|
17
24
|
APPARENT_POWER = "apparent_power"
|
|
18
25
|
"""Apparent power.
|
|
19
26
|
|
|
20
|
-
Unit of measurement: `VA`
|
|
27
|
+
Unit of measurement: `mVA`, `VA`, `kVA`
|
|
21
28
|
"""
|
|
22
29
|
|
|
23
30
|
AQI = "aqi"
|
|
@@ -26,6 +33,12 @@ class NumberDeviceClass(Enum):
|
|
|
26
33
|
Unit of measurement: `None`
|
|
27
34
|
"""
|
|
28
35
|
|
|
36
|
+
AREA = "area"
|
|
37
|
+
"""Area
|
|
38
|
+
|
|
39
|
+
Unit of measurement: `UnitOfArea` units
|
|
40
|
+
"""
|
|
41
|
+
|
|
29
42
|
ATMOSPHERIC_PRESSURE = "atmospheric_pressure"
|
|
30
43
|
"""Atmospheric pressure.
|
|
31
44
|
|
|
@@ -38,10 +51,16 @@ class NumberDeviceClass(Enum):
|
|
|
38
51
|
Unit of measurement: `%`
|
|
39
52
|
"""
|
|
40
53
|
|
|
54
|
+
BLOOD_GLUCOSE_CONCENTRATION = "blood_glucose_concentration"
|
|
55
|
+
"""Blood glucose concentration.
|
|
56
|
+
|
|
57
|
+
Unit of measurement: `mg/dL`, `mmol/L`
|
|
58
|
+
"""
|
|
59
|
+
|
|
41
60
|
CO = "carbon_monoxide"
|
|
42
61
|
"""Carbon Monoxide gas concentration.
|
|
43
62
|
|
|
44
|
-
Unit of measurement: `ppm` (parts per million)
|
|
63
|
+
Unit of measurement: `ppb` (parts per billion), `ppm` (parts per million), `mg/m³`, `μg/m³`
|
|
45
64
|
"""
|
|
46
65
|
|
|
47
66
|
CO2 = "carbon_dioxide"
|
|
@@ -50,6 +69,12 @@ class NumberDeviceClass(Enum):
|
|
|
50
69
|
Unit of measurement: `ppm` (parts per million)
|
|
51
70
|
"""
|
|
52
71
|
|
|
72
|
+
CONDUCTIVITY = "conductivity"
|
|
73
|
+
"""Conductivity.
|
|
74
|
+
|
|
75
|
+
Unit of measurement: `S/cm`, `mS/cm`, `μS/cm`
|
|
76
|
+
"""
|
|
77
|
+
|
|
53
78
|
CURRENT = "current"
|
|
54
79
|
"""Current.
|
|
55
80
|
|
|
@@ -79,13 +104,22 @@ class NumberDeviceClass(Enum):
|
|
|
79
104
|
DURATION = "duration"
|
|
80
105
|
"""Fixed duration.
|
|
81
106
|
|
|
82
|
-
Unit of measurement: `d`, `h`, `min`, `s`, `ms`
|
|
107
|
+
Unit of measurement: `d`, `h`, `min`, `s`, `ms`, `μs`
|
|
83
108
|
"""
|
|
84
109
|
|
|
85
110
|
ENERGY = "energy"
|
|
86
111
|
"""Energy.
|
|
87
112
|
|
|
88
|
-
Unit of measurement: `Wh`, `kWh`, `MWh`, `
|
|
113
|
+
Unit of measurement: `J`, `kJ`, `MJ`, `GJ`, `mWh`, `Wh`, `kWh`, `MWh`, `GWh`, `TWh`, `cal`, `kcal`, `Mcal`, `Gcal`
|
|
114
|
+
"""
|
|
115
|
+
|
|
116
|
+
ENERGY_DISTANCE = "energy_distance"
|
|
117
|
+
"""Energy distance.
|
|
118
|
+
|
|
119
|
+
Use this device class for sensors measuring energy by distance, for example the amount
|
|
120
|
+
of electric energy consumed by an electric car.
|
|
121
|
+
|
|
122
|
+
Unit of measurement: `kWh/100km`, `Wh/km`, `mi/kWh`, `km/kWh`
|
|
89
123
|
"""
|
|
90
124
|
|
|
91
125
|
ENERGY_STORAGE = "energy_storage"
|
|
@@ -94,7 +128,7 @@ class NumberDeviceClass(Enum):
|
|
|
94
128
|
Use this device class for sensors measuring stored energy, for example the amount
|
|
95
129
|
of electric energy currently stored in a battery or the capacity of a battery.
|
|
96
130
|
|
|
97
|
-
Unit of measurement: `Wh`, `kWh`, `MWh`, `
|
|
131
|
+
Unit of measurement: `J`, `kJ`, `MJ`, `GJ`, `mWh`, `Wh`, `kWh`, `MWh`, `GWh`, `TWh`, `cal`, `kcal`, `Mcal`, `Gcal`
|
|
98
132
|
"""
|
|
99
133
|
|
|
100
134
|
FREQUENCY = "frequency"
|
|
@@ -107,8 +141,8 @@ class NumberDeviceClass(Enum):
|
|
|
107
141
|
"""Gas.
|
|
108
142
|
|
|
109
143
|
Unit of measurement:
|
|
110
|
-
- SI / metric: `m³`
|
|
111
|
-
- USCS / imperial: `ft³`, `CCF`
|
|
144
|
+
- SI / metric: `L`, `m³`
|
|
145
|
+
- USCS / imperial: `ft³`, `CCF`, `MCF`
|
|
112
146
|
"""
|
|
113
147
|
|
|
114
148
|
HUMIDITY = "humidity"
|
|
@@ -148,25 +182,25 @@ class NumberDeviceClass(Enum):
|
|
|
148
182
|
NITROGEN_DIOXIDE = "nitrogen_dioxide"
|
|
149
183
|
"""Amount of NO2.
|
|
150
184
|
|
|
151
|
-
Unit of measurement:
|
|
185
|
+
Unit of measurement: `ppb` (parts per billion), `ppm` (parts per million), `μg/m³`
|
|
152
186
|
"""
|
|
153
187
|
|
|
154
188
|
NITROGEN_MONOXIDE = "nitrogen_monoxide"
|
|
155
189
|
"""Amount of NO.
|
|
156
190
|
|
|
157
|
-
Unit of measurement:
|
|
191
|
+
Unit of measurement: `ppb` (parts per billion), `μg/m³`
|
|
158
192
|
"""
|
|
159
193
|
|
|
160
194
|
NITROUS_OXIDE = "nitrous_oxide"
|
|
161
195
|
"""Amount of N2O.
|
|
162
196
|
|
|
163
|
-
Unit of measurement:
|
|
197
|
+
Unit of measurement: `μg/m³`
|
|
164
198
|
"""
|
|
165
199
|
|
|
166
200
|
OZONE = "ozone"
|
|
167
201
|
"""Amount of O3.
|
|
168
202
|
|
|
169
|
-
Unit of measurement:
|
|
203
|
+
Unit of measurement: `ppb` (parts per billion), `ppm` (parts per million), `μg/m³`
|
|
170
204
|
"""
|
|
171
205
|
|
|
172
206
|
PH = "ph"
|
|
@@ -178,19 +212,25 @@ class NumberDeviceClass(Enum):
|
|
|
178
212
|
PM1 = "pm1"
|
|
179
213
|
"""Particulate matter <= 1 μm.
|
|
180
214
|
|
|
181
|
-
Unit of measurement:
|
|
215
|
+
Unit of measurement: `μg/m³`
|
|
182
216
|
"""
|
|
183
217
|
|
|
184
218
|
PM10 = "pm10"
|
|
185
219
|
"""Particulate matter <= 10 μm.
|
|
186
220
|
|
|
187
|
-
Unit of measurement:
|
|
221
|
+
Unit of measurement: `μg/m³`
|
|
188
222
|
"""
|
|
189
223
|
|
|
190
224
|
PM25 = "pm25"
|
|
191
225
|
"""Particulate matter <= 2.5 μm.
|
|
192
226
|
|
|
193
|
-
Unit of measurement:
|
|
227
|
+
Unit of measurement: `μg/m³`
|
|
228
|
+
"""
|
|
229
|
+
|
|
230
|
+
PM4 = "pm4"
|
|
231
|
+
"""Particulate matter <= 4 μm.
|
|
232
|
+
|
|
233
|
+
Unit of measurement: `μg/m³`
|
|
194
234
|
"""
|
|
195
235
|
|
|
196
236
|
POWER_FACTOR = "power_factor"
|
|
@@ -202,7 +242,7 @@ class NumberDeviceClass(Enum):
|
|
|
202
242
|
POWER = "power"
|
|
203
243
|
"""Power.
|
|
204
244
|
|
|
205
|
-
Unit of measurement: `W`, `kW`
|
|
245
|
+
Unit of measurement: `mW`, `W`, `kW`, `MW`, `GW`, `TW`, `BTU/h`
|
|
206
246
|
"""
|
|
207
247
|
|
|
208
248
|
PRECIPITATION = "precipitation"
|
|
@@ -226,15 +266,22 @@ class NumberDeviceClass(Enum):
|
|
|
226
266
|
|
|
227
267
|
Unit of measurement:
|
|
228
268
|
- `mbar`, `cbar`, `bar`
|
|
229
|
-
- `Pa`, `hPa`, `kPa`
|
|
269
|
+
- `mPa`, `Pa`, `hPa`, `kPa`
|
|
230
270
|
- `inHg`
|
|
231
271
|
- `psi`
|
|
272
|
+
- `inH₂O`
|
|
273
|
+
"""
|
|
274
|
+
|
|
275
|
+
REACTIVE_ENERGY = "reactive_energy"
|
|
276
|
+
"""Reactive energy.
|
|
277
|
+
|
|
278
|
+
Unit of measurement: `varh`, `kvarh`
|
|
232
279
|
"""
|
|
233
280
|
|
|
234
281
|
REACTIVE_POWER = "reactive_power"
|
|
235
282
|
"""Reactive power.
|
|
236
283
|
|
|
237
|
-
Unit of measurement: `var`
|
|
284
|
+
Unit of measurement: `mvar`, `var`, `kvar`
|
|
238
285
|
"""
|
|
239
286
|
|
|
240
287
|
SIGNAL_STRENGTH = "signal_strength"
|
|
@@ -261,7 +308,7 @@ class NumberDeviceClass(Enum):
|
|
|
261
308
|
SULPHUR_DIOXIDE = "sulphur_dioxide"
|
|
262
309
|
"""Amount of SO2.
|
|
263
310
|
|
|
264
|
-
Unit of measurement:
|
|
311
|
+
Unit of measurement: `ppb` (parts per billion), `μg/m³`
|
|
265
312
|
"""
|
|
266
313
|
|
|
267
314
|
TEMPERATURE = "temperature"
|
|
@@ -270,10 +317,16 @@ class NumberDeviceClass(Enum):
|
|
|
270
317
|
Unit of measurement: `°C`, `°F`, `K`
|
|
271
318
|
"""
|
|
272
319
|
|
|
320
|
+
TEMPERATURE_DELTA = "temperature_delta"
|
|
321
|
+
"""Difference of temperatures - Temperature range.
|
|
322
|
+
|
|
323
|
+
Unit of measurement: `°C`, `°F`, `K`
|
|
324
|
+
"""
|
|
325
|
+
|
|
273
326
|
VOLATILE_ORGANIC_COMPOUNDS = "volatile_organic_compounds"
|
|
274
327
|
"""Amount of VOC.
|
|
275
328
|
|
|
276
|
-
Unit of measurement:
|
|
329
|
+
Unit of measurement: `μg/m³`, `mg/m³`
|
|
277
330
|
"""
|
|
278
331
|
|
|
279
332
|
VOLATILE_ORGANIC_COMPOUNDS_PARTS = "volatile_organic_compounds_parts"
|
|
@@ -285,7 +338,7 @@ class NumberDeviceClass(Enum):
|
|
|
285
338
|
VOLTAGE = "voltage"
|
|
286
339
|
"""Voltage.
|
|
287
340
|
|
|
288
|
-
Unit of measurement: `V`, `mV`
|
|
341
|
+
Unit of measurement: `V`, `mV`, `μV`, `kV`, `MV`
|
|
289
342
|
"""
|
|
290
343
|
|
|
291
344
|
VOLUME = "volume"
|
|
@@ -293,7 +346,7 @@ class NumberDeviceClass(Enum):
|
|
|
293
346
|
|
|
294
347
|
Unit of measurement: `VOLUME_*` units
|
|
295
348
|
- SI / metric: `mL`, `L`, `m³`
|
|
296
|
-
- USCS / imperial: `ft³`, `CCF`, `fl. oz.`, `gal` (warning: volumes expressed in
|
|
349
|
+
- USCS / imperial: `ft³`, `CCF`, `MCF`, `fl. oz.`, `gal` (warning: volumes expressed in
|
|
297
350
|
USCS/imperial units are currently assumed to be US volumes)
|
|
298
351
|
"""
|
|
299
352
|
|
|
@@ -305,7 +358,7 @@ class NumberDeviceClass(Enum):
|
|
|
305
358
|
|
|
306
359
|
Unit of measurement: `VOLUME_*` units
|
|
307
360
|
- SI / metric: `mL`, `L`, `m³`
|
|
308
|
-
- USCS / imperial: `ft³`, `CCF`, `fl. oz.`, `gal` (warning: volumes expressed in
|
|
361
|
+
- USCS / imperial: `ft³`, `CCF`, `MCF`, `fl. oz.`, `gal` (warning: volumes expressed in
|
|
309
362
|
USCS/imperial units are currently assumed to be US volumes)
|
|
310
363
|
"""
|
|
311
364
|
|
|
@@ -313,8 +366,8 @@ class NumberDeviceClass(Enum):
|
|
|
313
366
|
"""Generic flow rate
|
|
314
367
|
|
|
315
368
|
Unit of measurement: UnitOfVolumeFlowRate
|
|
316
|
-
- SI / metric: `m³/h`, `L/min`
|
|
317
|
-
- USCS / imperial: `ft³/min`, `gal/min`
|
|
369
|
+
- SI / metric: `m³/h`, `m³/min`, `m³/s`, `L/h`, `L/min`, `L/s`, `mL/s`
|
|
370
|
+
- USCS / imperial: `ft³/min`, `gal/min`, `gal/d`
|
|
318
371
|
"""
|
|
319
372
|
|
|
320
373
|
WATER = "water"
|
|
@@ -322,7 +375,7 @@ class NumberDeviceClass(Enum):
|
|
|
322
375
|
|
|
323
376
|
Unit of measurement:
|
|
324
377
|
- SI / metric: `m³`, `L`
|
|
325
|
-
- USCS / imperial: `ft³`, `CCF`, `gal` (warning: volumes expressed in
|
|
378
|
+
- USCS / imperial: `ft³`, `CCF`, `MCF`, `gal` (warning: volumes expressed in
|
|
326
379
|
USCS/imperial units are currently assumed to be US volumes)
|
|
327
380
|
"""
|
|
328
381
|
|
|
@@ -332,10 +385,16 @@ class NumberDeviceClass(Enum):
|
|
|
332
385
|
Weight is used instead of mass to fit with every day language.
|
|
333
386
|
|
|
334
387
|
Unit of measurement: `MASS_*` units
|
|
335
|
-
- SI / metric:
|
|
388
|
+
- SI / metric: `μg`, `mg`, `g`, `kg`
|
|
336
389
|
- USCS / imperial: `oz`, `lb`
|
|
337
390
|
"""
|
|
338
391
|
|
|
392
|
+
WIND_DIRECTION = "wind_direction"
|
|
393
|
+
"""Wind direction.
|
|
394
|
+
|
|
395
|
+
Unit of measurement: `°`
|
|
396
|
+
"""
|
|
397
|
+
|
|
339
398
|
WIND_SPEED = "wind_speed"
|
|
340
399
|
"""Wind speed.
|
|
341
400
|
|