This commit is contained in:
J. Nick Koston 2024-07-29 21:27:17 -05:00
parent 0c2a0118e2
commit 2208262ca5
No known key found for this signature in database
2 changed files with 11 additions and 3 deletions

View File

@ -528,9 +528,9 @@ def _async_subscribe_keypad_events(
button_type=button_type, button_type=button_type,
action=action, action=action,
) )
async_dispatcher_send( signal = f"{DOMAIN}_{config_entry_id}_button_{button_id}"
hass, f"{DOMAIN}_{config_entry_id}_button_{button_id}", data _LOGGER.warning("Sending signal: %s - %s", signal, data)
) async_dispatcher_send(hass, signal, data)
hass.bus.async_fire(LUTRON_CASETA_BUTTON_EVENT, data) hass.bus.async_fire(LUTRON_CASETA_BUTTON_EVENT, data)
for button_id in keypad_buttons: for button_id in keypad_buttons:

View File

@ -2,6 +2,8 @@
from __future__ import annotations from __future__ import annotations
import logging
from pylutron_caseta import BUTTON_STATUS_PRESSED, BUTTON_STATUS_RELEASED from pylutron_caseta import BUTTON_STATUS_PRESSED, BUTTON_STATUS_RELEASED
from homeassistant.components.event import EventDeviceClass, EventEntity from homeassistant.components.event import EventDeviceClass, EventEntity
@ -18,6 +20,8 @@ from .models import (
LutronCasetaData, LutronCasetaData,
) )
_LOGGER = logging.getLogger(__name__)
async def async_setup_entry( async def async_setup_entry(
hass: HomeAssistant, hass: HomeAssistant,
@ -67,6 +71,10 @@ class LutronCasetaButtonEvent(LutronCasetaDevice, EventEntity):
async def async_added_to_hass(self) -> None: async def async_added_to_hass(self) -> None:
"""Subscribe to button events.""" """Subscribe to button events."""
_LOGGER.warning(
"Subscribing to button %s",
f"{DOMAIN}_{self._entry_id}_button_{self._button_id}",
)
self.async_on_remove( self.async_on_remove(
async_dispatcher_connect( async_dispatcher_connect(
self.hass, self.hass,