Revert calls to color

This is break compatibility with IDF v5.
This commit is contained in:
Edward Firmo
2023-11-09 01:01:59 +01:00
parent e439953fdb
commit 44ab4adc43

View File

@@ -378,7 +378,7 @@ api:
foreground: int[]
background: int[]
then:
- lambda: set_component_color->execute(component, std::vector<int>(foreground.begin(), foreground.end()), std::vector<int>(background.begin(), background.end()));
- lambda: set_component_color->execute(component, foreground, background);
##### Service to show a notification-message on the screen #####
- service: notification_show
@@ -432,7 +432,7 @@ api:
{
if ((page_icon != std::string()) and (page_icon != ""))
disp1->set_component_text_printf("icon_state", "%s", page_icon.c_str());
set_component_color->execute("icon_state", std::vector<int>(page_icon_color.begin(), page_icon_color.end()), {-1});
set_component_color->execute("icon_state", page_icon_color, {});
}
# Service to show a QR code on the display (ex. for WiFi password)
@@ -490,9 +490,9 @@ api:
std::string btntext = btn_id.c_str() + std::string("text");
std::string btnbri = btn_id.c_str() + std::string("bri");
disp1->send_command_printf("%spic.pic=%" PRIu32, btn_id.c_str(), btn_pic);
set_component_color->execute(btnicon.c_str(), std::vector<int>(btn_icon_font.begin(), btn_icon_font.end()), std::vector<int>(btn_bg.begin(), btn_bg.end()));
set_component_color->execute(btntext.c_str(), std::vector<int>(btn_txt_font.begin(), btn_txt_font.end()), std::vector<int>(btn_bg.begin(), btn_bg.end()));
set_component_color->execute(btnbri.c_str(), std::vector<int>(btn_bri_font.begin(), btn_bri_font.end()), std::vector<int>(btn_bg.begin(), btn_bg.end()));
set_component_color->execute(btnicon.c_str(), btn_icon_font, btn_bg);
set_component_color->execute(btntext.c_str(), btn_txt_font, btn_bg);
set_component_color->execute(btnbri.c_str(), btn_bri_font, btn_bg);
disp1->set_component_text_printf(btnicon.c_str(), "%s", btn_icon.c_str());
display_wrapped_text->execute(btntext.c_str(), btn_label.c_str(), 10);
if (strcmp(btn_bri_txt.c_str(), "0") != 0)
@@ -551,25 +551,20 @@ api:
// Notification button
disp1->send_command_printf("is_notification=%i", (notification_text->state.empty() and notification_label->state.empty()) ? 0 : 1);
disp1->set_component_text_printf("home.bt_notific", "%s", notification_icon.c_str());
set_component_color->execute("home.bt_notific", notification_unread->state ?
std::vector<int>(notification_icon_color_unread.begin(), notification_icon_color_unread.end()) :
std::vector<int>(notification_icon_color_normal.begin(), notification_icon_color_normal.end()),
{-1});
id(home_notify_icon_color_normal) = std::vector<long int>(notification_icon_color_normal.begin(), notification_icon_color_normal.end());
id(home_notify_icon_color_unread) = std::vector<long int>(notification_icon_color_normal.begin(), notification_icon_color_normal.end());
set_component_color->execute("home.bt_notific", notification_unread->state ? notification_icon_color_unread : notification_icon_color_normal, {});
id(home_notify_icon_color_normal) = notification_icon_color_normal;
id(home_notify_icon_color_unread) = notification_icon_color_unread;
// QRCode button
disp1->send_command_printf("is_qrcode=%i", (qrcode) ? 1 : 0);
disp1->set_component_text_printf("home.bt_qrcode", "%s", qrcode_icon.c_str());
//set_component_color->execute("home.bt_qrcode", qrcode_icon_color, {});
set_component_color->execute("home.bt_entities", std::vector<int>(qrcode_icon_color.begin(), qrcode_icon_color.end()), {-1});
set_component_color->execute("home.bt_qrcode", qrcode_icon_color, {});
// Entities pages button
disp1->send_command_printf("is_entities=%i", (entities_pages) ? 1 : 0);
disp1->set_component_text_printf("home.bt_entities", "%s", entities_pages_icon.c_str());
//set_component_color->execute("home.bt_entities", entities_pages_icon_color, {});
set_component_color->execute("home.bt_entities", std::vector<int>(entities_pages_icon_color.begin(), entities_pages_icon_color.end()), {-1});
set_component_color->execute("home.bt_entities", entities_pages_icon_color, {});
// Alarm button
@@ -831,10 +826,10 @@ globals:
initial_value: '65535'
- id: home_notify_icon_color_normal
type: std::vector<long int>
type: std::vector<int>
restore_value: false
- id: home_notify_icon_color_unread
type: std::vector<long int>
type: std::vector<int>
restore_value: false
##### Versions #####
@@ -1210,9 +1205,9 @@ switch:
optimistic: true
restore_mode: ALWAYS_OFF
on_turn_on:
- lambda: set_component_color->execute("home.bt_notific", std::vector<int>(id(home_notify_icon_color_unread).begin(), id(home_notify_icon_color_unread).end()), {-1});
- lambda: set_component_color->execute("home.bt_notific", id(home_notify_icon_color_unread), {});
on_turn_off:
- lambda: set_component_color->execute("home.bt_notific", std::vector<int>(id(home_notify_icon_color_normal).begin(), id(home_notify_icon_color_normal).end()), {-1});
- lambda: set_component_color->execute("home.bt_notific", id(home_notify_icon_color_normal), {});
##### Notification sound #####
- name: ${device_name} Notification sound
@@ -2257,10 +2252,7 @@ script:
refresh_relays->execute();
refresh_wifi_icon->execute();
disp1->send_command_printf("is_notification=%i", (notification_text->state.empty() and notification_label->state.empty()) ? 0 : 1);
set_component_color->execute("home.bt_notific", notification_unread->state ?
std::vector<int>(id(home_notify_icon_color_unread).begin(), id(home_notify_icon_color_unread).end()) :
std::vector<int>(id(home_notify_icon_color_normal).begin(), id(home_notify_icon_color_normal).end()),
{-1});
set_component_color->execute("home.bt_notific", notification_unread->state ? id(home_notify_icon_color_unread) : id(home_notify_icon_color_normal), {});
refresh_datetime->execute();
addon_climate_update_page_home->execute();
}