Use initial_value for fw_url
It should be available together with the component
This commit is contained in:
@@ -32,8 +32,8 @@ api:
|
||||
url: string
|
||||
then:
|
||||
- ota_http.flash:
|
||||
md5_url: !lambda return id(fw_url).state + ".md5";
|
||||
url: !lambda return id(fw_url).state;
|
||||
md5_url: !lambda return fw_url->state + ".md5";
|
||||
url: !lambda return fw_url->state;
|
||||
- lambda: |-
|
||||
static const char *const TAG = "prebuilt.button.bt_firmware_update";
|
||||
ESP_LOGE(TAG, "Firmware update failed!");
|
||||
@@ -50,8 +50,8 @@ button:
|
||||
on_press:
|
||||
then:
|
||||
- ota_http.flash:
|
||||
md5_url: !lambda return id(fw_url).state + ".md5";
|
||||
url: !lambda return id(fw_url).state;
|
||||
md5_url: !lambda return fw_url->state + ".md5";
|
||||
url: !lambda return fw_url->state;
|
||||
- lambda: |-
|
||||
static const char *const TAG = "prebuilt.button.bt_firmware_update";
|
||||
ESP_LOGE(TAG, "Firmware update failed!");
|
||||
@@ -70,12 +70,6 @@ esphome:
|
||||
project:
|
||||
name: esphome.NSPanel_HA_Blueprint
|
||||
version: "${version}"
|
||||
on_boot:
|
||||
- priority: 602.0
|
||||
then:
|
||||
- text.set:
|
||||
id: fw_url
|
||||
value: "https://raw.githubusercontent.com/Blackymas/NSPanel_HA_Blueprint/main/prebuilt/nspanel_esphome_prebuilt.bin"
|
||||
platformio_options:
|
||||
build_flags:
|
||||
- -D NSPANEL_HA_BLUEPRINT_PREBUILT
|
||||
@@ -111,6 +105,16 @@ text:
|
||||
icon: mdi:cloud-download
|
||||
mode: text
|
||||
optimistic: true
|
||||
entity_category: config
|
||||
internal: false
|
||||
update_interval: never
|
||||
restore_value: true
|
||||
initial_value: "https://raw.githubusercontent.com/Blackymas/NSPanel_HA_Blueprint/main/prebuilt/nspanel_esphome_prebuilt.bin"
|
||||
on_value:
|
||||
then:
|
||||
- lambda: |-
|
||||
ESP_LOGD("text.fw_url", "New Firmware URL set: %s", x.c_str());
|
||||
|
||||
|
||||
wifi:
|
||||
networks: !remove
|
||||
|
||||
@@ -28,10 +28,8 @@ esphome:
|
||||
platformio_options:
|
||||
build_flags:
|
||||
- -D NSPANEL_HA_BLUEPRINT_PREBUILT_WALL_DISPLAY
|
||||
on_boot:
|
||||
- priority: 602.0
|
||||
then:
|
||||
- text.set:
|
||||
id: fw_url
|
||||
value: "https://raw.githubusercontent.com/Blackymas/NSPanel_HA_Blueprint/main/prebuilt/wall_display.bin"
|
||||
|
||||
text:
|
||||
- id: !extend fw_url
|
||||
initial_value: "https://raw.githubusercontent.com/Blackymas/NSPanel_HA_Blueprint/main/prebuilt/wall_display.bin"
|
||||
...
|
||||
|
||||
Reference in New Issue
Block a user