mirror of
https://github.com/randybb/esphome-configs.git
synced 2026-12-06 01:06:52 +01:00
ESPHome 2026.12: on_client_synced, CanPayload, cleanups
- LVGL panels (NSPanels, lvgl, lvgl-4848s040, m5core2, tft), m5paper: api on_client_synced instead of a 2 s delay and an api.connected check - car-can: on_frame x is canbus::CanPayload, frames_per_id keeps it without a heap vector - gateway: drop the commented ethernet (common/ethernet.yaml has it), LLDP (PR draft), manual_ip and use_address - clock-1, echo: drop the commented neopixelbus lights
This commit is contained in:
1 parent
01fe45ce8d
commit
0f6e2350cc
10 files changed
+16
-158
No files matched your search
@@ -81,13 +81,8 @@ ota:
|
||||
|
||||
api:
|
||||
# status page until Home Assistant connects (log viewers don't subscribe to states)
|
||||
on_client_connected:
|
||||
- delay: 2s
|
||||
- if:
|
||||
condition:
|
||||
api.connected:
|
||||
state_subscription_only: true
|
||||
then:
|
||||
# Home Assistant has subscribed and received every state
|
||||
on_client_synced:
|
||||
- lvgl.page.show: page_home
|
||||
on_client_disconnected:
|
||||
- if:
|
||||
|
||||
+4
-5
@@ -48,7 +48,7 @@ logger:
|
||||
globals:
|
||||
# CAN ID -> frames seen and the last data
|
||||
- id: frames_per_id
|
||||
type: std::map<uint32_t, std::pair<uint32_t, std::vector<uint8_t>>>
|
||||
type: std::map<uint32_t, std::pair<uint32_t, canbus::CanPayload>>
|
||||
- id: ecm_last_seen
|
||||
type: uint32_t
|
||||
initial_value: '0'
|
||||
@@ -80,13 +80,12 @@ canbus:
|
||||
0x262, 0x263, 0x266, 0x2C1, 0x2C3, 0x3A0, 0x3D3, 0x4AC,
|
||||
0x440, 0x442, 0x443, 0x44D, 0x640};
|
||||
bool watch = std::find(std::begin(noisy), std::end(noisy), can_id) == std::end(noisy);
|
||||
bool changed = e.second != x;
|
||||
bool changed = !std::equal(x.begin(), x.end(), e.second.begin(), e.second.end());
|
||||
// 0x224 (brake): byte 5 counts, compare the rest
|
||||
if (can_id == 0x224 && x.size() > 5 && e.second.size() == x.size()) {
|
||||
watch = true;
|
||||
auto a = x, b = e.second;
|
||||
a[5] = b[5] = 0;
|
||||
changed = a != b;
|
||||
changed = !std::equal(x.begin(), x.begin() + 5, e.second.begin()) ||
|
||||
!std::equal(x.begin() + 6, x.end(), e.second.begin() + 6);
|
||||
}
|
||||
if (watch && e.first > 1 && changed) {
|
||||
char hex[format_hex_pretty_size(8)];
|
||||
|
||||
@@ -51,60 +51,6 @@ api:
|
||||
- rtttl.play:
|
||||
rtttl: !lambda 'return song;'
|
||||
|
||||
# light:
|
||||
# - platform: neopixelbus
|
||||
# type: GRB
|
||||
# pin: 2
|
||||
# variant: WS2812
|
||||
# method: ESP8266_UART1
|
||||
# num_leds: 1
|
||||
# name: "${name} Light"
|
||||
# id: neo
|
||||
# effects:
|
||||
# # Use default parameters:
|
||||
# - random:
|
||||
# # Customize parameters
|
||||
# - random:
|
||||
# name: "My Slow Random Effect"
|
||||
# transition_length: 30s
|
||||
# update_interval: 30s
|
||||
# - random:
|
||||
# name: "My Fast Random Effect"
|
||||
# transition_length: 4s
|
||||
# update_interval: 5s
|
||||
# - strobe:
|
||||
# - strobe:
|
||||
# name: Strobe Effect With Custom Values
|
||||
# colors:
|
||||
# - state: True
|
||||
# brightness: 100%
|
||||
# red: 100%
|
||||
# green: 90%
|
||||
# blue: 0%
|
||||
# duration: 500ms
|
||||
# - state: False
|
||||
# duration: 250ms
|
||||
# - state: True
|
||||
# brightness: 100%
|
||||
# red: 0%
|
||||
# green: 100%
|
||||
# blue: 0%
|
||||
# duration: 500ms
|
||||
# - flicker:
|
||||
# - flicker:
|
||||
# name: Flicker Effect With Custom Values
|
||||
# alpha: 95%
|
||||
# intensity: 1.5%
|
||||
# - addressable_rainbow:
|
||||
# - addressable_rainbow:
|
||||
# name: Rainbow Effect With Custom Values
|
||||
# speed: 10
|
||||
# width: 50
|
||||
# - addressable_scan:
|
||||
# - addressable_scan:
|
||||
# name: Scan Effect With Custom Values
|
||||
# move_interval: 100ms
|
||||
|
||||
globals:
|
||||
- id: alarm_id
|
||||
type: bool
|
||||
|
||||
@@ -77,13 +77,6 @@ binary_sensor:
|
||||
id: media_out
|
||||
|
||||
light:
|
||||
# - platform: neopixelbus
|
||||
# type: GRB
|
||||
# pin: 27
|
||||
# variant: WS2812
|
||||
# num_leds: 1
|
||||
# name: On-Board LED"
|
||||
# id: neo_buildin
|
||||
- platform: rgb
|
||||
name: Light
|
||||
id: led_light
|
||||
|
||||
@@ -49,10 +49,6 @@ esp32:
|
||||
sram1_as_iram: true
|
||||
|
||||
external_components:
|
||||
# Ethernet LLDP 802.1AB transmitter
|
||||
# - source: github://pr#11760
|
||||
# components: [ethernet]
|
||||
# refresh: 1h
|
||||
- source: github://pr#2112
|
||||
components: ["m5stack_4relay"]
|
||||
refresh: 1h
|
||||
@@ -67,44 +63,6 @@ i2c:
|
||||
scl: 16
|
||||
scan: true
|
||||
|
||||
# ethernet:
|
||||
# lldp:
|
||||
# # Enable LLDP transmission
|
||||
# #enabled: true
|
||||
# # Optional: override default port
|
||||
# port: eth
|
||||
# # Optional: override default system name
|
||||
# system_name: mcu-${device}
|
||||
# # Optional: override default system description
|
||||
# system_description: ${comment}
|
||||
# # Optional: override default "fast mode" burst packet count
|
||||
# tx_fast_count: 4
|
||||
# # Optional: override default LLDP frame transmission interval
|
||||
# tx_interval: 30
|
||||
# # Optional: override default hold count, used in conjuction with tx_interval to calculate overall TTL
|
||||
# tx_hold: 4
|
||||
|
||||
# ethernet:
|
||||
# type: LAN8720
|
||||
# mdc_pin: 23
|
||||
# mdio_pin: 18
|
||||
# clk_mode: GPIO17_OUT
|
||||
# phy_addr: 0
|
||||
# power_pin: 12
|
||||
# use_address: 10.17.240.245
|
||||
|
||||
# # Optional manual IP
|
||||
# manual_ip:
|
||||
# static_ip: 10.17.240.254
|
||||
# gateway: 10.17.240.1
|
||||
# subnet: 255.255.255.0
|
||||
|
||||
|
||||
# ethernet:
|
||||
# use_address: 10.17.241.254
|
||||
# use_address: 10.17.241.98
|
||||
# use_address: mcu-gateway.local
|
||||
|
||||
uart:
|
||||
id: uart_modbus
|
||||
tx_pin: 4
|
||||
|
||||
@@ -86,13 +86,8 @@ packages:
|
||||
|
||||
api:
|
||||
# status page until Home Assistant connects (log viewers don't subscribe to states)
|
||||
on_client_connected:
|
||||
- delay: 2s
|
||||
- if:
|
||||
condition:
|
||||
api.connected:
|
||||
state_subscription_only: true
|
||||
then:
|
||||
# Home Assistant has subscribed and received every state
|
||||
on_client_synced:
|
||||
- lvgl.page.show: main_page
|
||||
on_client_disconnected:
|
||||
- if:
|
||||
|
||||
+2
-7
@@ -148,13 +148,8 @@ packages:
|
||||
|
||||
api:
|
||||
# status page until Home Assistant connects (log viewers don't subscribe to states)
|
||||
on_client_connected:
|
||||
- delay: 2s
|
||||
- if:
|
||||
condition:
|
||||
api.connected:
|
||||
state_subscription_only: true
|
||||
then:
|
||||
# Home Assistant has subscribed and received every state
|
||||
on_client_synced:
|
||||
- lvgl.page.show: main_page
|
||||
on_client_disconnected:
|
||||
- if:
|
||||
|
||||
+2
-7
@@ -127,13 +127,8 @@ mlx90640:
|
||||
|
||||
api:
|
||||
# status page until Home Assistant connects (log viewers don't subscribe to states)
|
||||
on_client_connected:
|
||||
- delay: 2s
|
||||
- if:
|
||||
condition:
|
||||
api.connected:
|
||||
state_subscription_only: true
|
||||
then:
|
||||
# Home Assistant has subscribed and received every state
|
||||
on_client_synced:
|
||||
- lvgl.page.show: {id: main_page, lvgl_id: lvgl_main}
|
||||
on_client_disconnected:
|
||||
- if:
|
||||
|
||||
+2
-15
@@ -124,14 +124,8 @@ wifi:
|
||||
- component.update: m5paper_display
|
||||
|
||||
api:
|
||||
# status screen until Home Assistant connects (log viewers don't subscribe to states)
|
||||
on_client_connected:
|
||||
- delay: 2s
|
||||
- if:
|
||||
condition:
|
||||
api.connected:
|
||||
state_subscription_only: true
|
||||
then:
|
||||
# status screen until Home Assistant has subscribed and received every state (log viewers don't subscribe)
|
||||
on_client_synced:
|
||||
- lambda: id(show_status) = false;
|
||||
- if:
|
||||
condition:
|
||||
@@ -139,13 +133,6 @@ api:
|
||||
then:
|
||||
- component.update: m5paper_display
|
||||
# outside the battery cycle (power button, USB) WiFi is up anyway: always refresh
|
||||
- if:
|
||||
condition:
|
||||
and:
|
||||
- lambda: return !id(calendar_page);
|
||||
- api.connected:
|
||||
state_subscription_only: true
|
||||
then:
|
||||
- script.execute: fetch_events
|
||||
on_client_disconnected:
|
||||
- if:
|
||||
|
||||
+2
-7
@@ -38,13 +38,8 @@ packages:
|
||||
|
||||
api:
|
||||
# status page until Home Assistant connects (log viewers don't subscribe to states)
|
||||
on_client_connected:
|
||||
- delay: 2s
|
||||
- if:
|
||||
condition:
|
||||
api.connected:
|
||||
state_subscription_only: true
|
||||
then:
|
||||
# Home Assistant has subscribed and received every state
|
||||
on_client_synced:
|
||||
- lvgl.page.show: main_page
|
||||
on_client_disconnected:
|
||||
- if:
|
||||
|
||||
Reference in new issue
Block a user