refactor
This commit is contained in:
parent
c62f0319e6
commit
e60b96d6e5
38 changed files with 1348 additions and 0 deletions
19
common/base.yaml
Normal file
19
common/base.yaml
Normal file
|
@ -0,0 +1,19 @@
|
|||
wifi:
|
||||
ssid: !secret WIFI_SSID
|
||||
password: !secret WIFI_PASSWORD
|
||||
fast_connect: true
|
||||
reboot_timeout: 300s
|
||||
ap:
|
||||
ssid: ${friendly_name} Hotspot
|
||||
|
||||
logger:
|
||||
level: DEBUG
|
||||
|
||||
api:
|
||||
reboot_timeout: 15min
|
||||
|
||||
ota:
|
||||
|
||||
time:
|
||||
- platform: homeassistant
|
||||
timezone: Europe/London
|
42
common/basicSensors.yaml
Normal file
42
common/basicSensors.yaml
Normal file
|
@ -0,0 +1,42 @@
|
|||
binary_sensor:
|
||||
- platform: status
|
||||
name: ${friendly_name} Status
|
||||
id: device_status
|
||||
|
||||
sensor:
|
||||
- platform: wifi_signal
|
||||
name: ${friendly_name} WiFi Signal Strength
|
||||
id: device_wifi_signal
|
||||
update_interval: 15s
|
||||
|
||||
- platform: uptime
|
||||
name: ${friendly_name} Uptime
|
||||
id: device_uptime
|
||||
update_interval: 15s
|
||||
|
||||
text_sensor:
|
||||
- platform: version
|
||||
name: ${friendly_name} ESPHome Version
|
||||
id: esphome_version
|
||||
|
||||
- platform: wifi_info
|
||||
ip_address:
|
||||
name: ${friendly_name} IP Address
|
||||
id: ip_address
|
||||
|
||||
ssid:
|
||||
name: ${friendly_name} SSID
|
||||
id: ssid
|
||||
|
||||
bssid:
|
||||
name: ${friendly_name} BSSID
|
||||
id: bssid
|
||||
|
||||
mac_address:
|
||||
name: ${friendly_name} MAC Address
|
||||
id: mac_address
|
||||
|
||||
switch:
|
||||
- platform: restart
|
||||
name: ${friendly_name} Restart
|
||||
id: device_restart
|
12
common/bluetoothProxy.yaml
Normal file
12
common/bluetoothProxy.yaml
Normal file
|
@ -0,0 +1,12 @@
|
|||
esp32:
|
||||
framework:
|
||||
type: esp-idf
|
||||
|
||||
esp32_ble_tracker:
|
||||
scan_parameters:
|
||||
interval: 1100ms
|
||||
window: 1100ms
|
||||
active: true
|
||||
|
||||
bluetooth_proxy:
|
||||
active: true
|
67
common/lightEffects.yaml
Normal file
67
common/lightEffects.yaml
Normal file
|
@ -0,0 +1,67 @@
|
|||
- lambda:
|
||||
name: RGB Breathing
|
||||
update_interval: 16s #Finetune to your liking with the transition lenght below
|
||||
lambda: |-
|
||||
#define Color1 1.0, 0.0, 0.0 //These are the colors defined, feel free to change or extend the list
|
||||
#define Color2 1.0, 0.5, 0.0 //if you extend the list, dont forget to add them in the switch loop below
|
||||
#define Color3 1.0, 1.0, 0.0 //and remember to adjust the reset counter at the bottom
|
||||
#define Color4 0.5, 1.0, 0.0
|
||||
#define Color5 0.0, 1.0, 0.0
|
||||
#define Color6 0.0, 1.0, 0.5
|
||||
#define Color7 0.0, 1.0, 1.0
|
||||
#define Color8 0.0, 0.5, 1.0
|
||||
#define Color9 0.0, 0.0, 1.0
|
||||
#define Color10 0.5, 0.0, 1.0
|
||||
#define Color11 0.5, 0.0, 1.0
|
||||
#define Color12 1.0, 0.0, 0.5
|
||||
static int state = 0;
|
||||
static int color = 1;
|
||||
auto call = id(light1).turn_on();
|
||||
call.set_transition_length(15000);
|
||||
if (state == 0)
|
||||
{
|
||||
call.set_brightness(0.01);
|
||||
|
||||
}
|
||||
else if (state == 1)
|
||||
{
|
||||
switch(color)
|
||||
{
|
||||
case 1: call.set_rgb(Color1);
|
||||
break;
|
||||
case 2: call.set_rgb(Color2);
|
||||
break;
|
||||
case 3: call.set_rgb(Color3);
|
||||
break;
|
||||
case 4: call.set_rgb(Color4);
|
||||
break;
|
||||
case 5: call.set_rgb(Color5);
|
||||
break;
|
||||
case 6: call.set_rgb(Color6);
|
||||
break;
|
||||
case 7: call.set_rgb(Color7);
|
||||
break;
|
||||
case 8: call.set_rgb(Color8);
|
||||
break;
|
||||
case 9: call.set_rgb(Color9);
|
||||
break;
|
||||
case 10: call.set_rgb(Color10);
|
||||
break;
|
||||
case 11: call.set_rgb(Color11);
|
||||
break;
|
||||
case 12: call.set_rgb(Color12);
|
||||
break;
|
||||
}
|
||||
call.set_brightness(1.0);
|
||||
}
|
||||
|
||||
state ++;
|
||||
if (state == 2){
|
||||
state = 0;
|
||||
}
|
||||
color++;
|
||||
if(color == 7)
|
||||
{
|
||||
color = 1;
|
||||
}
|
||||
call.perform();
|
Loading…
Add table
Add a link
Reference in a new issue