WIP disable wi-fi to avoid interferences
This commit is contained in:
@@ -1,5 +1,14 @@
|
|||||||
# NOTE: This program does NOT log via UART, but only via network socket (esphome logs...)
|
# NOTE: This program does NOT log via UART, but only via network socket (esphome logs...)
|
||||||
|
|
||||||
|
# Variables
|
||||||
|
globals:
|
||||||
|
# The ESP8266 Wi-fi interferes with the NFC reader, for this reason is usually
|
||||||
|
# disabled. When the devices is turned on with the "volume up" key pressed, it
|
||||||
|
# enables the wifi. Used for firmware update, home assistant control and as a night light.
|
||||||
|
- id: wifi_mode
|
||||||
|
type: bool
|
||||||
|
restore_value: no
|
||||||
|
initial_value: False
|
||||||
|
|
||||||
# ---------------------- Global config ----------------------
|
# ---------------------- Global config ----------------------
|
||||||
|
|
||||||
@@ -8,13 +17,20 @@ esphome:
|
|||||||
on_boot:
|
on_boot:
|
||||||
- priority: 300
|
- priority: 300
|
||||||
then:
|
then:
|
||||||
|
- if:
|
||||||
|
condition:
|
||||||
|
binary_sensor.is_on: vol_up
|
||||||
|
then: !lambda id(wifi_mode) = true;
|
||||||
|
#else:
|
||||||
|
# then:
|
||||||
|
# wifi.disable:
|
||||||
- dfplayer.set_volume: 10
|
- dfplayer.set_volume: 10
|
||||||
- light.turn_on:
|
- light.turn_on:
|
||||||
id: status_led
|
id: status_led
|
||||||
brightness: 60%
|
brightness: !lambda if (id(wifi_mode)) return 1.0; else return 0.6;
|
||||||
red: 80%
|
red: 0.8
|
||||||
green: 0%
|
green: !lambda if (id(wifi_mode)) return 1.0; else return 0.0;
|
||||||
blue: 100%
|
blue: 1.0
|
||||||
|
|
||||||
esp8266:
|
esp8266:
|
||||||
board: d1_mini_lite
|
board: d1_mini_lite
|
||||||
@@ -30,6 +46,7 @@ ota:
|
|||||||
wifi:
|
wifi:
|
||||||
ssid: "Pew"
|
ssid: "Pew"
|
||||||
password: "SediaChinita@Terrazzo2017"
|
password: "SediaChinita@Terrazzo2017"
|
||||||
|
reboot_timeout: 0s
|
||||||
|
|
||||||
|
|
||||||
# ---------------------- Global variables ----------------------
|
# ---------------------- Global variables ----------------------
|
||||||
@@ -247,6 +264,7 @@ api:
|
|||||||
# "folder": 2,
|
# "folder": 2,
|
||||||
# "file": 1
|
# "file": 1
|
||||||
# }
|
# }
|
||||||
|
reboot_timeout: 0s
|
||||||
|
|
||||||
actions:
|
actions:
|
||||||
- action: dfplayer_next
|
- action: dfplayer_next
|
||||||
|
|||||||
Reference in New Issue
Block a user