Home buttons new format - Alarm
Modernise the button Alarm flow on page Home to improve performance.
This commit is contained in:
@@ -504,7 +504,8 @@ api:
|
||||
## Alarm button
|
||||
- lambda: |-
|
||||
if (${verbose_log}) ESP_LOGD("service.global_settings", "Alarm button - Start");
|
||||
id(home_alarm_state) = alarm_state;
|
||||
id(disp1).send_command_printf("is_alarm=%i", (alarm_state=="" or alarm_state.empty()) ? 0 : 1);
|
||||
id(update_alarm_icon)->execute("home.bt_alarm", alarm_state.c_str());
|
||||
|
||||
## Wakeup page
|
||||
- lambda: |-
|
||||
@@ -549,8 +550,8 @@ api:
|
||||
|
||||
// set alarm icon on home page
|
||||
if (${verbose_log}) ESP_LOGD("service.alarm_settings", "Updating home page icon");
|
||||
id(home_alarm_state) = state;
|
||||
id(update_alarm_icon)->execute("home.button07_icon", state.c_str());
|
||||
id(disp1).send_command_printf("is_alarm=%i", (state=="" or state.empty()) ? 0 : 1);
|
||||
id(update_alarm_icon)->execute("home.bt_alarm", state.c_str());
|
||||
|
||||
## Update alarm page
|
||||
- if:
|
||||
@@ -709,12 +710,6 @@ globals:
|
||||
restore_value: true
|
||||
initial_value: '0'
|
||||
|
||||
##### Alarm state #####
|
||||
- id: home_alarm_state
|
||||
type: std::string
|
||||
restore_value: false
|
||||
initial_value: ''
|
||||
|
||||
##### Entities pages button #####
|
||||
- id: home_entities_pages
|
||||
type: bool
|
||||
@@ -1578,19 +1573,6 @@ script:
|
||||
id(disp1).hide_component("button06_icon");
|
||||
}
|
||||
|
||||
// Show alarm button
|
||||
if (${verbose_log}) ESP_LOGD("script.update_page_home", "Show alarm button");
|
||||
if (id(home_alarm_state) != "" and not id(home_alarm_state).empty())
|
||||
{
|
||||
id(update_alarm_icon)->execute("button07_icon", id(home_alarm_state));
|
||||
id(disp1).show_component("button07");
|
||||
id(disp1).show_component("button07_icon");
|
||||
}
|
||||
else
|
||||
{
|
||||
id(disp1).hide_component("button07");
|
||||
id(disp1).hide_component("button07_icon");
|
||||
}
|
||||
- script.execute:
|
||||
id: addon_climate_update_page_home
|
||||
- lambda: if (${verbose_log}) ESP_LOGD("script.update_page_home", "Finished");
|
||||
|
||||
Reference in New Issue
Block a user