mirror of
https://github.com/home-assistant/core.git
synced 2025-04-29 03:37:51 +00:00
Distinguish multiple raise lower buttons on one Lutron keypad (#92380)
This commit is contained in:
parent
e18f7dffb0
commit
2092bd225d
@ -37,6 +37,7 @@ LUTRON_DEVICES = "lutron_devices"
|
|||||||
# Attribute on events that indicates what action was taken with the button.
|
# Attribute on events that indicates what action was taken with the button.
|
||||||
ATTR_ACTION = "action"
|
ATTR_ACTION = "action"
|
||||||
ATTR_FULL_ID = "full_id"
|
ATTR_FULL_ID = "full_id"
|
||||||
|
ATTR_UUID = "uuid"
|
||||||
|
|
||||||
CONFIG_SCHEMA = vol.Schema(
|
CONFIG_SCHEMA = vol.Schema(
|
||||||
{
|
{
|
||||||
@ -170,6 +171,7 @@ class LutronButton:
|
|||||||
self._button = button
|
self._button = button
|
||||||
self._event = "lutron_event"
|
self._event = "lutron_event"
|
||||||
self._full_id = slugify(f"{area_name} {name}")
|
self._full_id = slugify(f"{area_name} {name}")
|
||||||
|
self._uuid = button.uuid
|
||||||
|
|
||||||
button.subscribe(self.button_callback, None)
|
button.subscribe(self.button_callback, None)
|
||||||
|
|
||||||
@ -188,5 +190,10 @@ class LutronButton:
|
|||||||
action = "single"
|
action = "single"
|
||||||
|
|
||||||
if action:
|
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)
|
self._hass.bus.fire(self._event, data)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user