From 28a155901fa0645ce538cf613f46bae8fd71316e Mon Sep 17 00:00:00 2001 From: John Dillenburg Date: Thu, 5 Dec 2024 18:59:15 -0600 Subject: [PATCH] Moved wifi related settings to their own file so they can be shared with other devices. --- .gitignore | 3 +++ garage-door-controller.yaml | 19 ++----------------- packages/wifi.yaml | 17 +++++++++++++++++ 3 files changed, 22 insertions(+), 17 deletions(-) create mode 100644 packages/wifi.yaml diff --git a/.gitignore b/.gitignore index e906118..6565fa5 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,6 @@ # List of files to consider for check in !garage-door-controller.yaml !TFmini.h +!/packages/ +!/packages/wifi.yaml +!/packages/beacon.yaml diff --git a/garage-door-controller.yaml b/garage-door-controller.yaml index f103aab..3aeef33 100644 --- a/garage-door-controller.yaml +++ b/garage-door-controller.yaml @@ -5,7 +5,8 @@ esphome: - TFmini.h packages: - beacon: !include { file: packages/beacon.yaml, vars: { area: "Garage" }} + beacon: !include { file: packages/beacon.yaml } + wifi: !include { file: packages/wifi.yaml, vars: { ssid: "garage-door-controller" }} substitutions: led_count: "60" @@ -27,23 +28,7 @@ api: ota: - platform: esphome password: !secret garage_door_ota_password - -wifi: - ssid: !secret wifi_ssid - password: !secret wifi_password - - # Enable fallback hotspot (captive portal) in case wifi connection fails - ap: - ssid: "Garage-Door-Controller" - password: !secret garage_door_ap_password - -web_server: - auth: - username: johndillenburg - password: !secret garage_door_ap_password -captive_portal: - globals: - id: sensor_counter type: int diff --git a/packages/wifi.yaml b/packages/wifi.yaml new file mode 100644 index 0000000..4e37678 --- /dev/null +++ b/packages/wifi.yaml @@ -0,0 +1,17 @@ +esphome: + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + + # Enable fallback hotspot (captive portal) in case wifi connection fails + ap: + ssid: "${ssid}" + password: !secret ap_and_web_server_password + +web_server: + auth: + username: johndillenburg + password: !secret ap_and_web_server_password + +captive_portal: