Clean-up Cover page
I'm preparing this page to have icons changing based on the device_class selected to a cover.
This commit is contained in:
@@ -554,7 +554,7 @@ api:
|
||||
// Alarm page - Buttons
|
||||
if (supported_features & 1) // Alarm - Button - Home
|
||||
{
|
||||
id(disp1).send_command_printf("bt_home_pic.pic=%i", (state=="armed_home") ? 133 : 132);
|
||||
id(disp1).send_command_printf("bt_home_pic.pic=%i", (state=="armed_home") ? 43 : 42);
|
||||
id(disp1).set_component_background_color("bt_home_text", (state=="armed_home") ? 19818 : 52857);
|
||||
id(disp1).set_component_background_color("bt_home_icon", (state=="armed_home") ? 19818 : 52857);
|
||||
id(disp1).set_component_font_color("bt_home_text", (state=="armed_home") ? 65535 : 0);
|
||||
@@ -563,7 +563,7 @@ api:
|
||||
}
|
||||
if (supported_features & 2) // Alarm - Button - Away
|
||||
{
|
||||
id(disp1).send_command_printf("bt_away_pic.pic=%i", (state=="armed_away") ? 133 : 132);
|
||||
id(disp1).send_command_printf("bt_away_pic.pic=%i", (state=="armed_away") ? 43 : 42);
|
||||
id(disp1).set_component_background_color("bt_away_text", (state=="armed_away") ? 19818 : 52857);
|
||||
id(disp1).set_component_background_color("bt_away_icon", (state=="armed_away") ? 19818 : 52857);
|
||||
id(disp1).set_component_font_color("bt_away_text", (state=="armed_away") ? 65535 : 0);
|
||||
@@ -572,7 +572,7 @@ api:
|
||||
}
|
||||
if (supported_features & 4) // Alarm - Button - Night
|
||||
{
|
||||
id(disp1).send_command_printf("bt_night_pic.pic=%i", (state=="armed_night") ? 133 : 132);
|
||||
id(disp1).send_command_printf("bt_night_pic.pic=%i", (state=="armed_night") ? 43 : 42);
|
||||
id(disp1).set_component_background_color("bt_night_text", (state=="armed_night") ? 19818 : 52857);
|
||||
id(disp1).set_component_background_color("bt_night_icon", (state=="armed_night") ? 19818 : 52857);
|
||||
id(disp1).set_component_font_color("bt_night_text", (state=="armed_night") ? 65535 : 0);
|
||||
@@ -581,7 +581,7 @@ api:
|
||||
}
|
||||
if (supported_features & 32) // Alarm - Button - Vacation
|
||||
{
|
||||
id(disp1).send_command_printf("bt_vacat_pic.pic=%i", (state=="armed_vacation") ? 133 : 132);
|
||||
id(disp1).send_command_printf("bt_vacat_pic.pic=%i", (state=="armed_vacation") ? 43 : 42);
|
||||
id(disp1).set_component_background_color("bt_vacat_text", (state=="armed_vacation") ? 19818 : 52857);
|
||||
id(disp1).set_component_background_color("bt_vacat_icon", (state=="armed_vacation") ? 19818 : 52857);
|
||||
id(disp1).set_component_font_color("bt_vacat_text", (state=="armed_vacation") ? 65535 : 0);
|
||||
@@ -590,7 +590,7 @@ api:
|
||||
}
|
||||
if (supported_features & 16) // Alarm - Button - Custom bypass
|
||||
{
|
||||
id(disp1).send_command_printf("bt_bypass_pic.pic=%i", (state=="armed_bypass") ? 133 : 132);
|
||||
id(disp1).send_command_printf("bt_bypass_pic.pic=%i", (state=="armed_bypass") ? 43 : 42);
|
||||
id(disp1).set_component_background_color("bt_bypass_text", (state=="armed_bypass") ? 19818 : 52857);
|
||||
id(disp1).set_component_background_color("bt_bypass_icon", (state=="armed_bypass") ? 19818 : 52857);
|
||||
id(disp1).set_component_font_color("bt_bypass_text", (state=="armed_bypass") ? 65535 : 0);
|
||||
@@ -599,7 +599,7 @@ api:
|
||||
}
|
||||
if ( true ) // Alarm - Button - Disarm
|
||||
{
|
||||
id(disp1).send_command_printf("bt_disarm_pic.pic=%i", (state=="disarmed") ? 133 : 132);
|
||||
id(disp1).send_command_printf("bt_disarm_pic.pic=%i", (state=="disarmed") ? 43 : 42);
|
||||
id(disp1).set_component_background_color("bt_disarm_text", (state=="disarmed") ? 19818 : 52857);
|
||||
id(disp1).set_component_background_color("bt_disarm_icon", (state=="disarmed") ? 19818 : 52857);
|
||||
id(disp1).set_component_font_color("bt_disarm_text", (state=="disarmed") ? 65535 : 0);
|
||||
@@ -1023,6 +1023,14 @@ text_sensor:
|
||||
id(disp1).set_component_text_printf("climate.button07_icon", "%s", "\uE424"); //mdi:power
|
||||
id(addon_climate_update_page_climate)->execute();
|
||||
}
|
||||
else if (page=="cover")
|
||||
{
|
||||
ESP_LOGV("text_sensor.nspanelevent", "Construct cover page");
|
||||
id(disp1).set_component_text_printf("cover.cover_stop", "%s", "\uE666"); //mdi:stop-circle-outline
|
||||
// In the future this will be dynamically contructed based on the device_class
|
||||
id(disp1).set_component_text_printf("cover.cover_open", "%s", "\uF11D"); //mdi:window-shutter-open
|
||||
id(disp1).set_component_text_printf("cover.cover_close", "%s", "\uF11B"); //mdi:window-shutter
|
||||
}
|
||||
else if (page=="fan")
|
||||
{
|
||||
ESP_LOGV("text_sensor.nspanelevent", "Construct fan page");
|
||||
|
||||
Reference in New Issue
Block a user