Performance improvements - Reduce triggers when line ref down't change signal

Solves #1977
This commit is contained in:
Edward Firmo
2024-03-31 23:51:30 +02:00
parent 6a93083eb7
commit 8531a49621
2 changed files with 47 additions and 55 deletions

View File

@@ -1608,6 +1608,24 @@ switch:
entity_category: config
optimistic: true
restore_mode: ALWAYS_OFF
on_turn_on:
lambda: |-
esphome::api::CustomAPIDevice ha_event;
ha_event.fire_homeassistant_event("esphome.nspanel_ha_blueprint", {
{"device_name", device_name->state.c_str()},
{"type", "notification_changed"},
{"component", "notification_unread"},
{"action", "turn_on"}
});
on_turn_off:
lambda: |-
esphome::api::CustomAPIDevice ha_event;
ha_event.fire_homeassistant_event("esphome.nspanel_ha_blueprint", {
{"device_name", device_name->state.c_str()},
{"type", "notification_changed"},
{"component", "notification_unread"},
{"action", "turn_off"}
});
##### Notification sound #####
- name: Notification sound
@@ -1738,10 +1756,28 @@ text_sensor:
- id: notification_label
name: Notification Label
platform: template
on_value:
lambda: |-
esphome::api::CustomAPIDevice ha_event;
ha_event.fire_homeassistant_event("esphome.nspanel_ha_blueprint", {
{"device_name", device_name->state.c_str()},
{"type", "notification_changed"},
{"component", "notification_label"},
{"action", "new_value"}
});
- id: notification_text
name: Notification Text
platform: template
on_value:
lambda: |-
esphome::api::CustomAPIDevice ha_event;
ha_event.fire_homeassistant_event("esphome.nspanel_ha_blueprint", {
{"device_name", device_name->state.c_str()},
{"type", "notification_changed"},
{"component", "notification_text"},
{"action", "new_value"}
});
##### NSPanel event - Execute actions from ESPHome - NO push to HA #####
- id: disp1_local_event