feat: add location and branch topology with scoped navigation

This commit is contained in:
jhartworks committed 2026-11-17 14:46:48 +01:00
1 parent 4a8da8ad0c
commit bffc4d0acc
30 files changed
+3172 -2491

No files matched your search

+20 -1
View File
@@ -10,7 +10,7 @@ import re
import voluptuous as vol
MAX_FLOORS = 20
MAX_FLOORS = 128
MAX_ROOMS = 200
MAX_POINTS = 200
MAX_ITEMS = 1000
@@ -855,6 +855,8 @@ FLOOR_SCHEMA = vol.Schema(
{
vol.Required("id"): _ID,
vol.Required("name"): _NAME,
vol.Optional("building_id"): vol.Any(None, _ID),
vol.Optional("outdoor_location_id"): vol.Any(None, _ID),
vol.Required("elevation"): vol.All(vol.Coerce(float), vol.Range(min=-100, max=500)),
vol.Required("height"): vol.All(vol.Coerce(float), vol.Range(min=1, max=20)),
vol.Required("cut_height"): vol.All(vol.Coerce(float), vol.Range(min=0.2, max=20)),
@@ -1199,9 +1201,26 @@ PRESENCE_SCHEMA = vol.Schema(
extra=vol.ALLOW_EXTRA,
)
TOPOLOGY_SCHEMA = vol.Schema(
{
vol.Required("locations"): vol.All(
[{vol.Required("id"): _ID, vol.Required("name"): _NAME}], vol.Length(max=128)
),
vol.Required("branches"): vol.All(
[{vol.Required("id"): _ID, vol.Required("name"): _NAME, vol.Required("location_id"): _ID}],
vol.Length(max=256),
),
vol.Required("buildings"): vol.All(
[{vol.Required("id"): _ID, vol.Required("name"): _NAME, vol.Required("branch_id"): _ID}],
vol.Length(max=512),
),
}
)
BUILDING_SCHEMA = vol.Schema(
{
vol.Required("version"): 1,
vol.Optional("topology"): TOPOLOGY_SCHEMA,
vol.Required("floors"): vol.All([FLOOR_SCHEMA], vol.Length(max=MAX_FLOORS)),
vol.Required("settings"): SETTINGS_SCHEMA,
vol.Optional("energy", default=lambda: dict(ENERGY_DEFAULTS)): ENERGY_SCHEMA,