Fix publish_state for new sensor

This commit is contained in:
Edward Firmo
2023-11-07 21:42:26 +01:00
parent f0394bb5bc
commit 137539e85c

View File

@@ -138,7 +138,7 @@ api:
// Is page Alarm visible?
if (current_page->state == "alarm") // To do: This page constructor should be moved to Blueprint
{ // Update alarm page
detailed_entity_id->publish_value(entity);
detailed_entity_id->publish_state(entity);
// Alarm page - Header
update_alarm_icon->execute("icon_state", state.c_str());
@@ -418,7 +418,7 @@ api:
back_page: string
then:
- lambda: |-
detailed_entity_id->publish_value(entity);
detailed_entity_id->publish_state(entity);
std::string cmd_page = std::string("page ") + page.c_str();
disp1->send_command_printf(cmd_page.c_str());
disp1->set_component_text_printf("page_label", "%s", page_label.c_str());
@@ -460,7 +460,7 @@ api:
entity: string
then:
- lambda: |-
if (current_page->state == "climate") detailed_entity_id->publish_value(entity);
if (current_page->state == "climate") detailed_entity_id->publish_state(entity);
- script.execute:
id: set_climate
@@ -609,7 +609,7 @@ api:
- lambda: |-
if (current_page->state == "media_player")
{
detailed_entity_id->publish_value(entity);
detailed_entity_id->publish_state(entity);
disp1->set_component_text_printf("page_label", "%s", friendly_name.c_str());
display_wrapped_text->execute("track", media_title.c_str(), id(display_mode) == 2 ? 16 : 27);
display_wrapped_text->execute("artist", media_artist.c_str(), id(display_mode) == 2 ? 26 : 40);
@@ -1402,7 +1402,7 @@ text_sensor:
{
if (page == "home" and component == "climate")
{
detailed_entity_id->publish_value((id(is_embedded_thermostat)) ? "embedded_climate" : "");
detailed_entity_id->publish_state((id(is_embedded_thermostat)) ? "embedded_climate" : "");
disp1->set_component_value("climate.embedded", (id(is_embedded_thermostat)) ? 1 : 0);
}
disp1->goto_page("climate");
@@ -2075,7 +2075,7 @@ script:
page != "media_player" &&
page != "confirm" &&
page != "keyb_num") {
detailed_entity_id->publish_value("");
detailed_entity_id->publish_state("");
}
if (page != "media_player") {
id(last_volume_level) = 0;