We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6b1f9b3 commit ac65380Copy full SHA for ac65380
1 file changed
tests/mock_data.py
@@ -154,10 +154,13 @@
154
_PRODUCTS_BY_ID: dict[str, HomeDataProduct] = {
155
p.id: p for p in (HomeDataProduct.from_dict(v) for v in PRODUCTS.values())
156
}
157
+_DEVICES_BY_FILENAME: dict[str, HomeDataDevice] = {
158
+ filename: HomeDataDevice.from_dict(device_data) for filename, device_data in DEVICES.items()
159
+}
160
DEVICE_PRODUCT_PAIRS: dict[str, tuple[HomeDataDevice, HomeDataProduct]] = {
- filename: (HomeDataDevice.from_dict(raw), product)
- for filename, raw in DEVICES.items()
- if (product := _PRODUCTS_BY_ID.get(HomeDataDevice.from_dict(raw).product_id)) is not None
161
+ filename: (device, product)
162
+ for filename, device in _DEVICES_BY_FILENAME.items()
163
+ if (product := _PRODUCTS_BY_ID.get(device.product_id)) is not None
164
165
166
0 commit comments