Distinguish multiple raise lower buttons on one Lutron keypad (#92380)

This commit is contained in:
Mike Knoop 2023-06-27 10:52:46 -07:00 committed by GitHub
parent e18f7dffb0
commit 2092bd225d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,6 +37,7 @@ LUTRON_DEVICES = "lutron_devices"
# Attribute on events that indicates what action was taken with the button.
ATTR_ACTION = "action"
ATTR_FULL_ID = "full_id"
ATTR_UUID = "uuid"
CONFIG_SCHEMA = vol.Schema(
{
@ -170,6 +171,7 @@ class LutronButton:
self._button = button
self._event = "lutron_event"
self._full_id = slugify(f"{area_name} {name}")
self._uuid = button.uuid
button.subscribe(self.button_callback, None)
@ -188,5 +190,10 @@ class LutronButton:
action = "single"
if action:
data = {ATTR_ID: self._id, ATTR_ACTION: action, ATTR_FULL_ID: self._full_id}
data = {
ATTR_ID: self._id,
ATTR_ACTION: action,
ATTR_FULL_ID: self._full_id,
ATTR_UUID: self._uuid,
}
self._hass.bus.fire(self._event, data)