feat: HA value source test — raw value axis + behavior IconSelect
Lint & Test / test (push) Successful in 1m9s

- WS sends raw_value and raw_range for HA entity streams
- Canvas draws right-side Y-axis labels: configured min/max range
  and current raw HA value (green, positioned at correct Y)
- Replace plain <select> for scene behavior with IconSelect (moon/sun)
This commit is contained in:
2026-03-30 03:06:44 +03:00
parent 11d5d6b5e1
commit 0a8737157c
5 changed files with 191 additions and 94 deletions
@@ -384,7 +384,13 @@ async def test_value_source_ws(
try:
while True:
value = stream.get_value()
await websocket.send_json({"value": round(value, 4)})
msg: dict = {"value": round(value, 4)}
if hasattr(stream, "get_raw_value"):
raw = stream.get_raw_value()
if raw is not None:
msg["raw_value"] = round(raw, 4)
msg["raw_range"] = [stream._min_ha, stream._max_ha]
await websocket.send_json(msg)
await asyncio.sleep(0.05)
except WebSocketDisconnect:
logger.debug("Value source test WebSocket disconnected for %s", source_id)