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>
138 lines
5.4 KiB
JSON
138 lines
5.4 KiB
JSON
{
|
|
"version": 1,
|
|
"ha": {
|
|
"url": "wss://ha.xtrm-lab.org/api/websocket",
|
|
"token": ""
|
|
},
|
|
"weather": {
|
|
"entity_id": "weather.forecast_home"
|
|
},
|
|
"vacuum": {
|
|
"entity_id": "vacuum.living_room_roborock_s7_pro_ultra",
|
|
"cleaning_mode_entity": "select.living_room_roborock_s7_pro_ultra_cleaning_mode",
|
|
"rooms": {
|
|
"16": "Kitchen",
|
|
"17": "Bedroom",
|
|
"18": "Dining Room",
|
|
"19": "Corridor",
|
|
"20": "Bathroom",
|
|
"21": "Living Room",
|
|
"22": "Master Bedroom",
|
|
"23": "Corridor 2",
|
|
"24": "Bedroom 2"
|
|
}
|
|
},
|
|
"rooms": [
|
|
{
|
|
"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",
|
|
"sensor.living_room_thermostat_humidity"
|
|
],
|
|
"cards": [
|
|
{ "type": "climate", "entity_id": "climate.living_room_thermostat", "name": "Thermostat" },
|
|
{ "type": "climate", "entity_id": "climate.living_room_radiator", "name": "Radiator" },
|
|
{ "type": "range", "entity_id": "light.living_room_light", "name": "Ceiling Light" },
|
|
{ "type": "range", "entity_id": "light.tv_lights", "name": "TV Lights" },
|
|
{ "type": "range", "entity_id": "light.rgbic_strip_lights_z1", "name": "LED Strip 1" },
|
|
{ "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": "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" }
|
|
]
|
|
},
|
|
{
|
|
"id": "kitchen",
|
|
"name": "Kitchen",
|
|
"background": "kitchen.jpg",
|
|
"sensors": [
|
|
"sensor.kitchen_termostat_temperature",
|
|
"sensor.kitchen_termostat_humidity"
|
|
],
|
|
"cards": [
|
|
{ "type": "climate", "entity_id": "climate.kitchen_termostat", "name": "Thermostat" },
|
|
{ "type": "toggle", "entity_id": "switch.dishwasher_power", "name": "Dishwasher" }
|
|
]
|
|
},
|
|
{
|
|
"id": "bedroom",
|
|
"name": "Dad's Bedroom",
|
|
"background": "bedroom.jpg",
|
|
"sensors": [],
|
|
"cards": [
|
|
{ "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" },
|
|
{ "type": "action", "entity_id": "scene.desk_mac", "name": "Desk: Mac" },
|
|
{ "type": "action", "entity_id": "scene.desk_pc", "name": "Desk: PC" }
|
|
]
|
|
},
|
|
{
|
|
"id": "dari_bedroom",
|
|
"name": "Dari's Bedroom",
|
|
"background": "dari-bedroom.jpg",
|
|
"sensors": [],
|
|
"cards": [
|
|
{ "type": "climate", "entity_id": "climate.girls_bedroom_radiator", "name": "Radiator" }
|
|
]
|
|
},
|
|
{
|
|
"id": "teo_s_bedroom",
|
|
"name": "Teo's Bedroom",
|
|
"background": "teo-bedroom.jpg",
|
|
"sensors": [],
|
|
"cards": [
|
|
{ "type": "toggle", "entity_id": "light.boys_smartlight", "name": "Light" }
|
|
]
|
|
},
|
|
{
|
|
"id": "main_bathroom",
|
|
"name": "Main Bathroom",
|
|
"background": "bathroom.jpg",
|
|
"sensors": [],
|
|
"cards": [
|
|
{ "type": "toggle", "entity_id": "light.bathroom_light_1", "name": "Light 1" },
|
|
{ "type": "toggle", "entity_id": "light.bathroom_light_2", "name": "Light 2" }
|
|
]
|
|
},
|
|
{
|
|
"id": "kids_bathroom",
|
|
"name": "Kids Bathroom",
|
|
"background": "kids-bathroom.jpg",
|
|
"sensors": [],
|
|
"cards": [
|
|
{ "type": "toggle", "entity_id": "light.kids_bathroom_light_1", "name": "Light 1" },
|
|
{ "type": "toggle", "entity_id": "light.kids_bathroom_light_2", "name": "Light 2" },
|
|
{ "type": "toggle", "entity_id": "switch.washing_machine_power", "name": "Washing Machine" },
|
|
{ "type": "toggle", "entity_id": "switch.dryer_power", "name": "Dryer" }
|
|
]
|
|
}
|
|
]
|
|
}
|