From 12ed2e770460fc09f435ab3364cbba9f781773a0 Mon Sep 17 00:00:00 2001 From: Artem Sheremet Date: Mon, 23 Oct 2023 12:21:47 +0200 Subject: [PATCH] Move restart button into a template --- templates/esp32-poe.yaml | 6 +----- templates/esp8266.yaml | 6 +----- templates/mystrom.yaml | 5 +---- templates/restart.yaml | 4 ++++ 4 files changed, 7 insertions(+), 14 deletions(-) create mode 100644 templates/restart.yaml diff --git a/templates/esp32-poe.yaml b/templates/esp32-poe.yaml index b97fd2d..cb7779a 100644 --- a/templates/esp32-poe.yaml +++ b/templates/esp32-poe.yaml @@ -19,8 +19,4 @@ packages: ota: !include ota.yaml mqtt: !include mqtt.yaml uptime: !include uptime.yaml - -button: -- platform: restart - name: "ESP chip restart" - entity_category: diagnostic + restart: !include restart.yaml diff --git a/templates/esp8266.yaml b/templates/esp8266.yaml index c810f11..46f2220 100644 --- a/templates/esp8266.yaml +++ b/templates/esp8266.yaml @@ -6,6 +6,7 @@ packages: ota: !include ota.yaml mqtt: !include mqtt.yaml uptime: !include uptime.yaml + restart: !include restart.yaml logger: @@ -18,8 +19,3 @@ status_led: # https://lowvoltage.github.io/2017/07/09/Onboard-LEDs-NodeMCU-Got-Two number: GPIO16 inverted: true - -button: -- platform: restart - name: "ESP chip restart" - entity_category: diagnostic diff --git a/templates/mystrom.yaml b/templates/mystrom.yaml index f93a957..02b0986 100644 --- a/templates/mystrom.yaml +++ b/templates/mystrom.yaml @@ -20,13 +20,10 @@ packages: ota: !include ota.yaml wifi: !include wifi.yaml uptime: !include uptime.yaml + restart: !include restart.yaml logger: -button: -- platform: restart - name: "ESP chip restart" - i2c: sda: 22 scl: 19 diff --git a/templates/restart.yaml b/templates/restart.yaml new file mode 100644 index 0000000..cbd6ae4 --- /dev/null +++ b/templates/restart.yaml @@ -0,0 +1,4 @@ +button: +- platform: restart + name: "ESP chip restart" + entity_category: diagnostic