Dashboard Studio 1.10.0: phone dashboards, room card, changelog
- Phone dashboards: a 4-column layout designed at phone width, with conversion both ways; on phones the top bar is hidden and comes back with a touch-and-hold on an empty spot - Room card built from Home Assistant areas (area, device and entity registries): climate, lights on with an all-lights toggle, thermostat, open doors and windows, motion, media, and device buttons - CHANGELOG.md for Home Assistant's Changelog tab, served at /api/changelog and shown under About > What's new Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -141,6 +141,14 @@ async def users(request):
|
||||
return web.json_response([{"id": k, **v} for k, v in load_users().items()], headers={"Cache-Control": "no-store"})
|
||||
|
||||
|
||||
async def changelog(request):
|
||||
try:
|
||||
text = (APP_DIR / "CHANGELOG.md").read_text()
|
||||
except OSError:
|
||||
text = ""
|
||||
return web.Response(text=text, content_type="text/markdown", headers={"Cache-Control": "no-store"})
|
||||
|
||||
|
||||
async def version(request):
|
||||
return web.json_response({"version": VERSION}, headers={"Cache-Control": "no-store"})
|
||||
|
||||
@@ -248,6 +256,7 @@ def make_app():
|
||||
app = web.Application(middlewares=[ingress_only], client_max_size=8 * 1024 * 1024)
|
||||
app.router.add_get("/", index)
|
||||
app.router.add_get("/api/version", version)
|
||||
app.router.add_get("/api/changelog", changelog)
|
||||
app.router.add_get("/api/whoami", whoami)
|
||||
app.router.add_get("/api/users", users)
|
||||
app.router.add_get("/api/dashboards", get_dashboards)
|
||||
|
||||
@@ -312,6 +312,26 @@ class MockHA:
|
||||
elif typ == "history/history_during_period":
|
||||
start = req.get("start_time") or (datetime.now(timezone.utc) - timedelta(hours=24)).isoformat()
|
||||
await ws.send_json({"id": mid, "type": "result", "success": True, "result": self.history(req.get("entity_ids", []), start)})
|
||||
elif typ == "config/area_registry/list":
|
||||
await ws.send_json({"id": mid, "type": "result", "success": True, "result": [
|
||||
{"area_id": "living_room", "name": "Living Room", "icon": None, "temperature_entity_id": "sensor.living_room_temperature", "humidity_entity_id": "sensor.living_room_humidity"},
|
||||
{"area_id": "kitchen", "name": "Kitchen", "icon": None},
|
||||
{"area_id": "bedroom", "name": "Bedroom", "icon": None},
|
||||
{"area_id": "office", "name": "Office", "icon": None},
|
||||
{"area_id": "garage", "name": "Garage", "icon": None},
|
||||
]})
|
||||
elif typ == "config/entity_registry/list":
|
||||
areas = {
|
||||
"living_room": ["light.living_room", "light.reading_lamp", "light.downstairs", "media_player.living_room_speaker", "media_player.tv", "sensor.living_room_temperature", "sensor.living_room_humidity", "binary_sensor.hallway_motion", "climate.thermostat"],
|
||||
"kitchen": ["light.kitchen", "switch.coffee_machine", "media_player.kitchen_speaker", "sensor.washer_status"],
|
||||
"bedroom": ["light.bedroom", "binary_sensor.front_door"],
|
||||
"office": ["fan.office", "input_boolean.guest_mode"],
|
||||
"garage": ["cover.garage_door", "lock.front_door"],
|
||||
}
|
||||
rows = [{"entity_id": e, "area_id": a, "device_id": None, "disabled_by": None, "hidden_by": None, "entity_category": None} for a, es in areas.items() for e in es]
|
||||
await ws.send_json({"id": mid, "type": "result", "success": True, "result": rows})
|
||||
elif typ == "config/device_registry/list":
|
||||
await ws.send_json({"id": mid, "type": "result", "success": True, "result": []})
|
||||
elif typ == "ping":
|
||||
await ws.send_json({"id": mid, "type": "pong"})
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user