10 Commits

Author SHA1 Message Date
alexei.dolgolyov f101ca4c73 feat: expose scene presets as voice-controllable scene.* entities (0.5.0)
Add a SCENE platform (scene.py) so each scene preset becomes a scene.*
entity. Alexa / Google Assistant / HomeKit expose the scene, light, and
switch domains — but NOT button — so the existing button.* scene entities
are invisible to voice assistants. Scenes use a distinct unique_id so both
coexist (buttons for dashboards, scenes for voice).

- Register Platform.SCENE; bump manifest 0.4.0 -> 0.5.0
- README: "Voice Control (Alexa / Google / Siri)" guide (Nabu Casa cloud,
  manual skill linking, HomeKit bridge, voice-friendly naming)
2026-06-23 00:50:38 +03:00
alexei.dolgolyov eca6cb516a chore: add .gitignore and track vex index config 2026-06-08 16:01:38 +03:00
alexei.dolgolyov 705616f8b0 feat(playlists): expose scene playlists as Home Assistant entities
One device per scene playlist (model "Scene Playlist"), each with:
- a switch (start/stop; the server cycles one playlist at a time, so starting one stops any other)
- a "Current Scene" sensor that resolves the active preset name from scene_presets while this playlist is cycling
- an "Items" diagnostic sensor (configured scene count; no state_class)

The coordinator reads scene_playlists plus the flat playlist_state from the /api/v1/snapshot payload and gains start_playlist()/stop_playlist(); __init__ registers and prunes per-playlist devices and reloads on playlist-id changes; the event listener also refreshes on the playlist_state_changed WS event. Shared device/lookup/running-state plumbing lives in a new LedGrabPlaylistEntity base (entity.py) used by both the switch and the sensors. Adds en/ru translation keys.

Note: this also lands the in-progress coordinator migration from the per-request fan-out to the single /api/v1/snapshot poll that was already present in the working tree.

Requires the led-grab server /api/v1/snapshot to emit scene_playlists + playlist_state (companion server change, tracked separately).
2026-06-08 15:59:42 +03:00
alexei.dolgolyov a666d9eb9c feat: server telemetry, update entity, sync-clock controls
- Server device exposing CPU/RAM/GPU/temperature/battery sensors via
  /api/v1/system/performance, plus last-restart timestamp (cached with
  jitter threshold so the recorder doesn't see poll wobble) and version.
- Update entity backed by /api/v1/system/update — installs via
  /apply, hides the install button when the server reports
  can_auto_update=false.
- Sync-clock entities: reset button, speed number, running switch, and
  the event listener now refreshes on entity_changed events too.
- Bump manifest to 0.4.0.
2026-04-27 01:35:42 +03:00
alexei.dolgolyov e8f2b5e528 docs(set_leds): note that segment start/length are now optional
The set_leds service handler is already pass-through, so the new
server-side defaults (start=0, length=rest-of-strip) work with no
code change. Refresh the field descriptions in services.yaml and
strings.json so the UI surfaces the simpler {"mode","color"} payload.
2026-04-26 23:45:25 +03:00
alexei.dolgolyov ca5b0a8014 feat(light): periodic color keep-alive for api_input lights
Background task re-pushes the current color at ~timeout/2 (clamped
0.5-30s) while the light is on, so the server's idle timer never
expires and the strip stays at the picked color instead of reverting
to fallback_color.

Drops the length: 9999 magic value from segment payloads now that the
server defaults length to the remainder of the strip — requires the
matching server change in led-grab.
2026-04-26 23:34:06 +03:00
alexei.dolgolyov 30085c00b9 fix(light): drop redundant name override on api_input light
The name property returned the source name, which is also the device
name — combined with _attr_has_entity_name=True this produced
entity ids like light.api_input_api_input. Removing it lets the
translation key drive the entity name (Light / Подсветка), yielding
light.<source>_light.
2026-04-26 02:32:30 +03:00
alexei.dolgolyov 0a16dc9058 feat(api-input): expose timeout/interpolation, fix 422 on light turn-on
- coordinator.update_source now auto-injects source_type from cached data so
  the server's discriminated-union body validates (was rejecting
  fallback_color updates with 422).
- Add Fallback Timeout (number) and Interpolation (select) entities per
  api_input CSS source.
- Light no longer zeros fallback_color on turn_off; state restored across
  HA restarts via RestoreEntity so the chosen default color persists.
- Bump manifest to 0.2.2 and update en/ru translations.
2026-04-26 02:26:06 +03:00
alexei.dolgolyov 5c8b3c259a fix(events): use first-message auth handshake for event WebSocket
The server dropped the ?token=<key> query-param WS auth in favor of a
first-message {"type":"auth","token":...} handshake that must complete
within 3 s, so the old query-param connection silently timed out on the
server side and we reconnected every ~8 s in a tight loop.

Send the handshake right after ws_connect, wait up to 5 s for auth_ok,
and treat auth rejection as a connection error so the reconnect backoff
kicks in instead of hot-looping. Bumps manifest to 0.2.1.
2026-04-21 15:16:54 +03:00
alexei.dolgolyov 579553a850 feat: initial release — LedGrab Home Assistant integration
HACS-compatible custom component split out from the main LedGrab repo.
Creates light, switch, sensor, number, and select entities for each
configured LedGrab device.
2026-04-12 22:32:46 +03:00