From f2c417cb0625b81cf36da5c28a0705ba59d42027 Mon Sep 17 00:00:00 2001
From: Jan Grewe <jan@faked.org>
Date: Sat, 25 Nov 2023 18:31:31 +0100
Subject: [PATCH] fix power plugs not saving switch state

---
 packages/nous_a1t.yaml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/packages/nous_a1t.yaml b/packages/nous_a1t.yaml
index d1743b6..bc4c407 100644
--- a/packages/nous_a1t.yaml
+++ b/packages/nous_a1t.yaml
@@ -4,6 +4,7 @@ substitutions:
 
 esp8266:
   board: esp8285
+  restore_from_flash: true
 
 light:
   - platform: status_led
@@ -13,7 +14,6 @@ light:
       inverted: true
 
 binary_sensor:
-  # toggle relay on/off
   - platform: gpio
     id: button_state
     pin:
@@ -25,8 +25,8 @@ binary_sensor:
 switch:
   - platform: template
     name: "Power"
-    optimistic: true
     id: power
+    restore_mode: RESTORE_DEFAULT_OFF
     lambda: |-
       if (id(relay).state) {
         return true;
-- 
GitLab