mirror of
https://github.com/Anonym-tsk/smart-domofon.git
synced 2025-12-06 11:36:57 +03:00
Refactoring
This commit is contained in:
@@ -4,17 +4,6 @@
|
|||||||
############# User configuration #############
|
############# User configuration #############
|
||||||
|
|
||||||
substitutions:
|
substitutions:
|
||||||
# Ge1mer board
|
|
||||||
board: esp12e
|
|
||||||
pin_relay_answer: GPIO14 # 330 Ohm, NO relay
|
|
||||||
pin_relay_phone: GPIO16 # Intercom, NC relay
|
|
||||||
pin_relay_mute: GPIO12 # 50 Ohm, NO relay
|
|
||||||
pin_led_red: GPIO5
|
|
||||||
pin_led_green: GPIO4
|
|
||||||
pin_led_blue: GPIO15
|
|
||||||
pin_call_detect: GPIO13
|
|
||||||
pin_btn_accept: GPIO0
|
|
||||||
|
|
||||||
# Build configuration
|
# Build configuration
|
||||||
board_name: "Domofon"
|
board_name: "Domofon"
|
||||||
mdns_name: "domofon"
|
mdns_name: "domofon"
|
||||||
@@ -24,9 +13,9 @@ substitutions:
|
|||||||
phone_relay_inverted: 'true' # Set to 'false' if you have NO phone relay
|
phone_relay_inverted: 'true' # Set to 'false' if you have NO phone relay
|
||||||
|
|
||||||
# Wifi credentials
|
# Wifi credentials
|
||||||
wifi_ssid: "-----"
|
wifi_ssid: !secret wifi_ssid
|
||||||
wifi_password: ""
|
wifi_password: !secret wifi_password
|
||||||
ap_ssid: "Domofon"
|
ap_ssid: "domofon"
|
||||||
ap_password: "1234567890"
|
ap_password: "1234567890"
|
||||||
|
|
||||||
# MQTT credentials
|
# MQTT credentials
|
||||||
@@ -47,15 +36,8 @@ substitutions:
|
|||||||
########### End user configuration ###########
|
########### End user configuration ###########
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
base: !include domofon_packages/base.yaml
|
base: github://Anonym-tsk/smart-domofon/ge1mer/esphome/packages/base.yaml@master
|
||||||
api: !include domofon_packages/api.yaml
|
api: github://Anonym-tsk/smart-domofon/ge1mer/esphome/packages/api.yaml@master
|
||||||
#mqtt: !include domofon_packages/mqtt.yaml
|
#mqtt: github://Anonym-tsk/smart-domofon/ge1mer/esphome/packages/mqtt.yaml@master
|
||||||
#web_server: !include domofon_packages/web_server.yaml
|
#web_server: github://Anonym-tsk/smart-domofon/ge1mer/esphome/packages/web_server.yaml@master
|
||||||
#captive_portal: !include domofon_packages/captive_portal.yaml
|
#captive_portal: github://Anonym-tsk/smart-domofon/ge1mer/esphome/packages/captive_portal.yaml@master
|
||||||
number: !include domofon_packages/number.yaml
|
|
||||||
script: !include domofon_packages/script.yaml
|
|
||||||
output: !include domofon_packages/output.yaml
|
|
||||||
switch: !include domofon_packages/switch.yaml
|
|
||||||
button: !include domofon_packages/button.yaml
|
|
||||||
light: !include domofon_packages/light.yaml
|
|
||||||
binary_sensor: !include domofon_packages/binary_sensor.yaml
|
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
# 8 times click - run captive portal
|
|
||||||
timing:
|
|
||||||
- ON for 5ms to 1s
|
|
||||||
- OFF for 5ms to 1s
|
|
||||||
- ON for 5ms to 1s
|
|
||||||
- OFF for 5ms to 1s
|
|
||||||
- ON for 5ms to 1s
|
|
||||||
- OFF for 5ms to 1s
|
|
||||||
- ON for 5ms to 1s
|
|
||||||
- OFF for 5ms to 1s
|
|
||||||
- ON for 5ms to 1s
|
|
||||||
- OFF for 5ms to 1s
|
|
||||||
- ON for 5ms to 1s
|
|
||||||
- OFF for 5ms to 1s
|
|
||||||
- ON for 5ms to 1s
|
|
||||||
- OFF for 5ms to 1s
|
|
||||||
- ON for 5ms to 1s
|
|
||||||
then:
|
|
||||||
lambda: |-
|
|
||||||
ESP_LOGW("DMF", "Erase settings and restart...");
|
|
||||||
captive_portal::global_captive_portal->override_sta_mqtt("-----", "", "10.0.0.1", "1883", "", "");
|
|
||||||
delay(500);
|
|
||||||
ESP.restart();
|
|
||||||
@@ -3,7 +3,7 @@ esphome:
|
|||||||
build_path: $build_path
|
build_path: $build_path
|
||||||
platform: ESP8266
|
platform: ESP8266
|
||||||
board: $board
|
board: $board
|
||||||
comment: "https://github.com/Anonym-tsk/smart-domofon/tree/master/ge1mer"
|
comment: "espdomofon.ru"
|
||||||
esp8266_restore_from_flash: true
|
esp8266_restore_from_flash: true
|
||||||
project:
|
project:
|
||||||
name: "espdomofon.ru"
|
name: "espdomofon.ru"
|
||||||
@@ -97,3 +97,24 @@ text_sensor:
|
|||||||
name: "${board_name} Uptime"
|
name: "${board_name} Uptime"
|
||||||
icon: mdi:clock-start
|
icon: mdi:clock-start
|
||||||
entity_category: "diagnostic"
|
entity_category: "diagnostic"
|
||||||
|
|
||||||
|
substitutions:
|
||||||
|
# Ge1mer board
|
||||||
|
board: esp12e
|
||||||
|
pin_relay_answer: GPIO14 # 330 Ohm, NO relay
|
||||||
|
pin_relay_phone: GPIO16 # Intercom, NC relay
|
||||||
|
pin_relay_mute: GPIO12 # 50 Ohm, NO relay
|
||||||
|
pin_led_red: GPIO5
|
||||||
|
pin_led_green: GPIO4
|
||||||
|
pin_led_blue: GPIO15
|
||||||
|
pin_call_detect: GPIO13
|
||||||
|
pin_btn_accept: GPIO0
|
||||||
|
|
||||||
|
packages:
|
||||||
|
number: !include number.yaml
|
||||||
|
script: !include script.yaml
|
||||||
|
output: !include output.yaml
|
||||||
|
switch: !include switch.yaml
|
||||||
|
button: !include button.yaml
|
||||||
|
light: !include light.yaml
|
||||||
|
binary_sensor: !include binary_sensor.yaml
|
||||||
@@ -84,4 +84,32 @@ binary_sensor:
|
|||||||
id(mode_auto_reject) = false;
|
id(mode_auto_reject) = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# - <<: !include includes/binary_sensor.captive.yaml
|
|
||||||
|
# # 8 clicks - forget wifi settings
|
||||||
|
# - timing:
|
||||||
|
# - ON for 5ms to 1s
|
||||||
|
# - OFF for 5ms to 1s
|
||||||
|
# - ON for 5ms to 1s
|
||||||
|
# - OFF for 5ms to 1s
|
||||||
|
# - ON for 5ms to 1s
|
||||||
|
# - OFF for 5ms to 1s
|
||||||
|
# - ON for 5ms to 1s
|
||||||
|
# - OFF for 5ms to 1s
|
||||||
|
# - ON for 5ms to 1s
|
||||||
|
# - OFF for 5ms to 1s
|
||||||
|
# - ON for 5ms to 1s
|
||||||
|
# - OFF for 5ms to 1s
|
||||||
|
# - ON for 5ms to 1s
|
||||||
|
# - OFF for 5ms to 1s
|
||||||
|
# - ON for 5ms to 1s
|
||||||
|
# then:
|
||||||
|
# lambda: |-
|
||||||
|
# ESP_LOGW("DMF", "Erase settings and restart...");
|
||||||
|
# id(mode_auto_open) = false;
|
||||||
|
# id(mode_auto_open_once) = false;
|
||||||
|
# id(mode_auto_reject) = false;
|
||||||
|
# id(mode_mute) = false;
|
||||||
|
# id(mode_mute_once) = false;
|
||||||
|
# wifi::global_wifi_component->save_wifi_sta("-----", "");
|
||||||
|
# delay(500);
|
||||||
|
# ESP.restart();
|
||||||
Reference in New Issue
Block a user