fix: group utility overview by area and show explicit room meters

This commit is contained in:
jhartworks committed 2026-11-12 12:09:21 +01:00
1 parent 8c6b23bd22
commit 93c015ec77
17 files changed
+1475 -1253

No files matched your search

+10 -7
View File
@@ -43,6 +43,14 @@ START_VIEW_SCHEMA = vol.Schema(
extra=vol.ALLOW_EXTRA,
)
_UTILITY_METERS = vol.Any(
None,
{
vol.Optional(kind): {vol.Optional("power"): _ENTITY_REF, vol.Optional("energy"): _ENTITY_REF}
for kind in ("electricity", "water", "gas", "heating", "cooling")
},
)
ROOM_SCHEMA = vol.Schema(
{
# room climate read from chosen sensors (None = automatic, "none" = no value)
@@ -58,6 +66,7 @@ ROOM_SCHEMA = vol.Schema(
vol.Required("id"): _ID,
vol.Required("name"): _NAME,
vol.Required("area_id"): vol.Any(None, vol.All(str, vol.Length(max=255))),
vol.Optional("utility_meters"): _UTILITY_METERS,
# light moods saved in the room panel: each light off, or on with brightness and colour
vol.Optional("moods"): vol.All(
[
@@ -788,13 +797,7 @@ FLOOR_SCHEMA = vol.Schema(
),
# the floor's own meter: a power sensor shown on the floor label and the house card of this floor
vol.Optional("power_entity", default=None): vol.Any(None, vol.All(str, vol.Length(max=255))),
vol.Optional("utility_meters"): vol.Any(
None,
{
vol.Optional(kind): {vol.Optional("power"): _ENTITY_REF, vol.Optional("energy"): _ENTITY_REF}
for kind in ("electricity", "water", "gas", "heating", "cooling")
},
),
vol.Optional("utility_meters"): _UTILITY_METERS,
vol.Optional("outdoor", default=list): vol.All([OUTDOOR_SCHEMA], vol.Length(max=MAX_ITEMS)),
# free-standing walls (partitions); room walls come from the room edges
vol.Optional("walls", default=list): vol.All([FREE_WALL_SCHEMA], vol.Length(max=MAX_ITEMS)),