feat(smarthome): live state values for devices and sensors - #207
Merged
Conversation
- V65 migration: smarthome_resources.state_json (cached normalized live state).
- Sync/poll caches state per resource: light/plug {on,bri}, group {on:any_on},
sensor {type,value} (temp °C, humidity %, lightlevel lux, presence/open/water bool).
- upsertResource persists state_json (omit = keep existing); rowToResource exposes state.
- UI reflects real state: power switch + brightness slider preset from state;
sensor cards show formatted value (incl. open/closed, motion, water labels).
- Visibility/focus-aware ~30s auto-poll mirrors the server poll.
- i18n: 6 value labels en+de + GC.t bridge (3 layouts), parity verified.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TP1.x — zeigt echte Live-Zustände statt Platzhalter (Folge der Klassifizierung #206).
Backend:
smarthome_resources.state_json— gecachter, normalisierter Live-Zustand.{on,bri}(bri 0–100), Gruppe{on: any_on}, Sensor{type,value}(Temperatur °C, Feuchte %, Helligkeit lux, Bewegung/offen/Wasser bool).upsertResourceschreibtstate_json(weglassen = bestehenden Zustand behalten);rowToResourceliefertstate.UI:
GC.t-Bridge in allen 3 Layouts (Parität verifiziert).Tests: State-Cache + Klassifizierung + sensorReading unit-getestet; Suite 42/42; Layouts kompilieren.
Hinweis: Werte aktualisieren sich nach dem Server-Poll (~30 s). Nach dem Deploy ggf. einmal „Synchronisieren" für den Sofort-Stand.
🤖 Generated with Claude Code