Add WS-based pairing flow, replacing config.json with token file
Replace the static config.json with a dynamic pairing flow: the TV shows a 6-digit PIN, the user enters it on the HA pairing web page, and the TV polls for the provisioned token. On success the token is persisted and the WS connection fetches entity config via luma/get_config. New modules: - ha_token: atomic read/write/remove of HA credentials file - ha_pairing: background HTTP poll service with getrandom PIN generation Key changes: - Settings UI: new HA section with URL entry, connect/disconnect, PIN display - ha_client: WS config fetch (luma/get_config), Option<u64> pending tracking - main.rs: token-based startup, pairing effects consolidated into effects() - renderer: cached GL uniform locations (u_aa, u_texture, u_clip_rounded, u_clip_radius, u_edge_fade) — no more per-batch GetUniformLocation calls - view.rs: extracted card_glow() helper, slider_card_target() method - Pairing thread detached (no join in Drop) to avoid blocking the render loop Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
483b19f286
commit
ba4a5d2346
13 files changed
+928
-280
No files matched your search
+29
-41
@@ -24,8 +24,22 @@
|
||||
},
|
||||
"rooms": [
|
||||
{
|
||||
"id": "living_room",
|
||||
"name": "Living Room",
|
||||
"id": "home",
|
||||
"name": "Home",
|
||||
"background": "living-room.jpg",
|
||||
"sensors": [
|
||||
"sensor.living_room_thermostat_temperature",
|
||||
"sensor.living_room_thermostat_humidity"
|
||||
],
|
||||
"cards": [
|
||||
{ "type": "weather", "entity_id": "weather.forecast_home", "name": "Weather" },
|
||||
{ "type": "media", "entity_id": "media_player.music_assistant", "name": "Music" },
|
||||
{ "type": "vacuum", "entity_id": "vacuum.living_room_roborock_s7_pro_ultra", "name": "Roborock" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "living_area",
|
||||
"name": "Living Area",
|
||||
"background": "living-room.jpg",
|
||||
"sensors": [
|
||||
"sensor.living_room_thermostat_temperature",
|
||||
@@ -40,8 +54,16 @@
|
||||
{ "type": "range", "entity_id": "light.rgbic_strip_lights_z2", "name": "LED Strip 2" },
|
||||
{ "type": "toggle", "entity_id": "light.picture_frame_lamp", "name": "Picture Lamp" },
|
||||
{ "type": "curtain", "entity_id": "cover.living_room_curtain", "name": "Curtain" },
|
||||
{ "type": "vacuum", "entity_id": "vacuum.living_room_roborock_s7_pro_ultra", "name": "Roborock" },
|
||||
{ "type": "media", "entity_id": "media_player.music_assistant", "name": "Music" }
|
||||
{ "type": "range", "entity_id": "light.dining_room_light", "name": "Dining Light" },
|
||||
{ "type": "toggle", "entity_id": "light.entrance_light_1", "name": "Entrance" },
|
||||
{ "type": "toggle", "entity_id": "light.entrance_mirror_light", "name": "Mirror" },
|
||||
{ "type": "action", "entity_id": "scene.tv_mode", "name": "TV Mode" },
|
||||
{ "type": "action", "entity_id": "scene.living_room_100", "name": "Living Room 100%" },
|
||||
{ "type": "action", "entity_id": "scene.living_room_lights_10", "name": "Living Room 10%" },
|
||||
{ "type": "action", "entity_id": "script.tv_ambient_on", "name": "TV Ambient On" },
|
||||
{ "type": "action", "entity_id": "script.tv_ambient_off", "name": "TV Ambient Off" },
|
||||
{ "type": "action", "entity_id": "script.living_dining_all_off", "name": "All Lights Off" },
|
||||
{ "type": "action", "entity_id": "scene.curtains_close", "name": "Close Curtains" }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -66,26 +88,9 @@
|
||||
{ "type": "climate", "entity_id": "climate.main_bedroom_radiator", "name": "Radiator" },
|
||||
{ "type": "toggle", "entity_id": "light.bedroom_ceiling_light", "name": "Ceiling" },
|
||||
{ "type": "toggle", "entity_id": "light.bedroom_desk_lights", "name": "Desk" },
|
||||
{ "type": "range", "entity_id": "light.bedroom_led_strip", "name": "LED Strip" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "dining_room",
|
||||
"name": "Dining Room",
|
||||
"background": "dining-room.jpg",
|
||||
"sensors": [],
|
||||
"cards": [
|
||||
{ "type": "range", "entity_id": "light.dining_room_light", "name": "Light" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "entrance",
|
||||
"name": "Entrance",
|
||||
"background": "entrance.jpg",
|
||||
"sensors": [],
|
||||
"cards": [
|
||||
{ "type": "toggle", "entity_id": "light.entrance_light_1", "name": "Light" },
|
||||
{ "type": "toggle", "entity_id": "light.entrance_mirror_light", "name": "Mirror" }
|
||||
{ "type": "range", "entity_id": "light.bedroom_led_strip", "name": "LED Strip" },
|
||||
{ "type": "action", "entity_id": "scene.desk_mac", "name": "Desk: Mac" },
|
||||
{ "type": "action", "entity_id": "scene.desk_pc", "name": "Desk: PC" }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -127,23 +132,6 @@
|
||||
{ "type": "toggle", "entity_id": "switch.washing_machine_power", "name": "Washing Machine" },
|
||||
{ "type": "toggle", "entity_id": "switch.dryer_power", "name": "Dryer" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "scenes",
|
||||
"name": "Scenes",
|
||||
"background": "scenes.jpg",
|
||||
"sensors": [],
|
||||
"cards": [
|
||||
{ "type": "action", "entity_id": "scene.tv_mode", "name": "TV Mode" },
|
||||
{ "type": "action", "entity_id": "scene.living_room_100", "name": "Living Room 100%" },
|
||||
{ "type": "action", "entity_id": "scene.living_room_lights_10", "name": "Living Room 10%" },
|
||||
{ "type": "action", "entity_id": "scene.desk_mac", "name": "Desk: Mac" },
|
||||
{ "type": "action", "entity_id": "scene.desk_pc", "name": "Desk: PC" },
|
||||
{ "type": "action", "entity_id": "scene.curtains_close", "name": "Close Curtains" },
|
||||
{ "type": "action", "entity_id": "script.tv_ambient_on", "name": "TV Ambient On" },
|
||||
{ "type": "action", "entity_id": "script.tv_ambient_off", "name": "TV Ambient Off" },
|
||||
{ "type": "action", "entity_id": "script.living_dining_all_off", "name": "All Lights Off" }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user