Enable translations of Settings page
This commit is contained in:
@@ -553,6 +553,25 @@ api:
|
||||
// Logs - End
|
||||
ESP_LOGV("service.page_home_settings", "Finished");
|
||||
|
||||
#### Service to populate the page Settings #####
|
||||
- service: page_settings
|
||||
variables:
|
||||
reboot: string
|
||||
sleep_mode: string
|
||||
brightness: string
|
||||
dimming: string
|
||||
then:
|
||||
- lambda: |-
|
||||
ESP_LOGV("service.page_settings", "Starting");
|
||||
ESP_LOGV("service.page_settings", "reboot: %s", reboot.c_str());
|
||||
ESP_LOGV("service.page_settings", "sleep_mode: %s", sleep_mode.c_str());
|
||||
ESP_LOGV("service.page_settings", "brightness: %s", brightness.c_str());
|
||||
ESP_LOGV("service.page_settings", "dimming: %s", dimming.c_str());
|
||||
if (not reboot.empty()) id(disp1).set_component_text_printf("settings.lbl_reboot", "%s", reboot.c_str());
|
||||
if (not sleep_mode.empty()) id(disp1).set_component_text_printf("settings.lbl_sleep", "%s", sleep_mode.c_str());
|
||||
if (not brightness.empty()) id(disp1).set_component_text_printf("settings.lbl_brightness", "%s", brightness.c_str());
|
||||
if (not dimming.empty()) id(disp1).set_component_text_printf("settings.lbl_dimming", "%s", dimming.c_str());
|
||||
|
||||
#### Service to populate the alarm settings page #####
|
||||
- service: alarm_settings
|
||||
variables:
|
||||
@@ -1282,14 +1301,14 @@ switch:
|
||||
ESP_LOGV("switch.sleep_mode", "Turn on");
|
||||
id(disp1).send_command_printf("sleep_mode=1");
|
||||
id(disp1).set_component_value("settings.bt_sleep",1);
|
||||
id(disp1).set_component_text_printf("bt_sleep", "%s", "\uEA19");
|
||||
id(disp1).set_component_text_printf("settings.bt_sleep", "%s", "\uEA19");
|
||||
id(sleep_mode).publish_state(true);
|
||||
turn_off_action: &sleep_mode-turn_off
|
||||
- lambda: |-
|
||||
ESP_LOGV("switch.sleep_mode", "Turn off");
|
||||
id(disp1).send_command_printf("sleep_mode=0");
|
||||
id(disp1).set_component_value("settings.bt_sleep",0);
|
||||
id(disp1).set_component_text_printf("bt_sleep", "%s", "\uEA18");
|
||||
id(disp1).set_component_text_printf("settings.bt_sleep", "%s", "\uEA18");
|
||||
id(sleep_mode).publish_state(false);
|
||||
|
||||
##### Relay Local control #####
|
||||
|
||||
Reference in New Issue
Block a user