60 lines
2.5 KiB
YAML
60 lines
2.5 KiB
YAML
text_sensor:
|
|
- platform: wifi_info
|
|
ip_address:
|
|
name: "Family Room Remote IP"
|
|
id: ip_addr
|
|
|
|
- platform: homeassistant
|
|
id: ts_family_room_tv_stand
|
|
entity_id: light.family_room_tv_stand
|
|
internal: true
|
|
on_value:
|
|
then:
|
|
- lvgl.widget.update:
|
|
id: btn_family_room_tv_stand
|
|
state:
|
|
checked: !lambda return x == "on";
|
|
- lambda: |-
|
|
const lv_color_t text_color = (x == "on") ? lv_color_hex(0x001A33) : lv_color_hex(0xE3E2E6);
|
|
auto *btn = id(btn_family_room_tv_stand);
|
|
lv_obj_set_style_text_color(btn, text_color, static_cast<lv_style_selector_t>(LV_PART_MAIN | LV_STATE_DEFAULT));
|
|
for (uint32_t i = 0; i < lv_obj_get_child_cnt(btn); i++) {
|
|
lv_obj_set_style_text_color(lv_obj_get_child(btn, i), text_color, static_cast<lv_style_selector_t>(LV_PART_MAIN | LV_STATE_DEFAULT));
|
|
}
|
|
|
|
- platform: homeassistant
|
|
id: ts_small_family_room_lamp
|
|
entity_id: light.small_family_room_lamp
|
|
internal: true
|
|
on_value:
|
|
then:
|
|
- lvgl.widget.update:
|
|
id: btn_small_family_room_lamp
|
|
state:
|
|
checked: !lambda return x == "on";
|
|
- lambda: |-
|
|
const lv_color_t text_color = (x == "on") ? lv_color_hex(0x22001F) : lv_color_hex(0xE3E2E6);
|
|
auto *btn = id(btn_small_family_room_lamp);
|
|
lv_obj_set_style_text_color(btn, text_color, static_cast<lv_style_selector_t>(LV_PART_MAIN | LV_STATE_DEFAULT));
|
|
for (uint32_t i = 0; i < lv_obj_get_child_cnt(btn); i++) {
|
|
lv_obj_set_style_text_color(lv_obj_get_child(btn, i), text_color, static_cast<lv_style_selector_t>(LV_PART_MAIN | LV_STATE_DEFAULT));
|
|
}
|
|
|
|
- platform: homeassistant
|
|
id: ts_big_family_room_lamp
|
|
entity_id: switch.big_family_room_lamp
|
|
internal: true
|
|
on_value:
|
|
then:
|
|
- lvgl.widget.update:
|
|
id: btn_big_family_room_lamp
|
|
state:
|
|
checked: !lambda return x == "on";
|
|
- lambda: |-
|
|
const lv_color_t text_color = (x == "on") ? lv_color_hex(0x001F15) : lv_color_hex(0xE3E2E6);
|
|
auto *btn = id(btn_big_family_room_lamp);
|
|
lv_obj_set_style_text_color(btn, text_color, static_cast<lv_style_selector_t>(LV_PART_MAIN | LV_STATE_DEFAULT));
|
|
for (uint32_t i = 0; i < lv_obj_get_child_cnt(btn); i++) {
|
|
lv_obj_set_style_text_color(lv_obj_get_child(btn, i), text_color, static_cast<lv_style_selector_t>(LV_PART_MAIN | LV_STATE_DEFAULT));
|
|
}
|