feat: add native charging station telemetry and aliased lock status
This commit is contained in:
1 parent
df4a6f36a3
commit
59292517b7
24 files changed
+1756
-1304
No files matched your search
@@ -19,6 +19,25 @@ from custom_components.nextfloor.schema import (
|
||||
ROOM = {"id": "r1", "name": "Bad", "area_id": None, "points": [[0, 0], [2, 0], [2, 2]], "floor_material": "tiles"}
|
||||
|
||||
|
||||
def test_charging_station_links_formats_and_clearing_survive_validation() -> None:
|
||||
charging = {
|
||||
"soc": "cover.1",
|
||||
"start": "light.2",
|
||||
"end": "sensor.3",
|
||||
"duration": "switch.4",
|
||||
"energy": "climate.5",
|
||||
"lock": "cover.6",
|
||||
"start_format": "seconds",
|
||||
"end_format": "milliseconds",
|
||||
"duration_unit": "minutes",
|
||||
}
|
||||
assert FURNITURE_SCHEMA({**FURN, "charging": charging})["charging"] == charging
|
||||
assert FURNITURE_SCHEMA({**FURN, "charging": None})["charging"] is None
|
||||
for invalid in ({"lock": 123}, {"duration_unit": "days"}, {"start_format": "guess"}):
|
||||
with pytest.raises(vol.Invalid):
|
||||
FURNITURE_SCHEMA({**FURN, "charging": invalid})
|
||||
|
||||
|
||||
def test_explicit_room_meters_accept_native_refs_and_clear_without_changing_the_area() -> None:
|
||||
room = {**ROOM, "area_id": "symcon-category-100"}
|
||||
meters = {"electricity": {"power": "cover.123", "energy": "sensor.456"}, "water": {"energy": None}}
|
||||
|
||||
Reference in new issue
Block a user