Remove script.service_call_climate
To make things simpler
This commit is contained in:
@@ -1570,7 +1570,14 @@ text_sensor:
|
||||
disp1->goto_page(wakeup_page_name->state.c_str());
|
||||
}
|
||||
}
|
||||
else if (page == "climate") service_call_climate->execute(entity.c_str(), key.c_str(), value.c_str(), (embedded==1));
|
||||
else if (page == "climate") {
|
||||
if (embedded==1)
|
||||
addon_climate_service_call->execute(key.c_str(), value.c_str());
|
||||
else if (key == "set_temperature")
|
||||
ha_call_service->execute("climate.set_temperature", "temperature", to_string(stof(value) / 10), entity.c_str());
|
||||
else if (key == "hvac_mode")
|
||||
ha_call_service->execute("climate.set_hvac_mode", key.c_str(), value.c_str(), entity.c_str());
|
||||
}
|
||||
else if (page == "cover")
|
||||
{
|
||||
if (key == "position") ha_call_service->execute("cover.set_cover_position", key.c_str(), value.c_str(), entity.c_str());
|
||||
@@ -2292,25 +2299,6 @@ script:
|
||||
api_server->send_homeassistant_service_call(resp);
|
||||
}
|
||||
|
||||
- id: service_call_climate
|
||||
mode: restart
|
||||
parameters:
|
||||
entity: string
|
||||
key: string
|
||||
value: string
|
||||
embedded: bool
|
||||
then:
|
||||
- lambda: |-
|
||||
static const char *const TAG = "script.service_call_climate";
|
||||
ESP_LOGV(TAG, "Calling climate service");
|
||||
if (embedded)
|
||||
addon_climate_service_call->execute(key.c_str(), value.c_str());
|
||||
else if (key == "set_temperature")
|
||||
ha_call_service->execute("climate.set_temperature", "temperature", to_string(stof(value) / 10), entity.c_str());
|
||||
else if (key == "hvac_mode")
|
||||
ha_call_service->execute("climate.set_hvac_mode", key.c_str(), value.c_str(), entity.c_str());
|
||||
ESP_LOGV(TAG, "Finished");
|
||||
|
||||
- id: set_brightness
|
||||
mode: restart
|
||||
parameters:
|
||||
@@ -2471,7 +2459,6 @@ script:
|
||||
refresh_relays->stop();
|
||||
refresh_wifi_icon->stop();
|
||||
service_call_alarm_control_panel->stop();
|
||||
service_call_climate->stop();
|
||||
set_brightness->stop();
|
||||
set_climate->stop();
|
||||
set_component_color->stop();
|
||||
|
||||
Reference in New Issue
Block a user