From 93fe46509f22340158974f9704a37b601a5a5b2a Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 29 Jul 2024 21:19:07 -0500 Subject: [PATCH] lint --- homeassistant/components/lutron_caseta/__init__.py | 4 +++- homeassistant/components/lutron_caseta/event.py | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/lutron_caseta/__init__.py b/homeassistant/components/lutron_caseta/__init__.py index d26d0f91f85..03f5245199c 100644 --- a/homeassistant/components/lutron_caseta/__init__.py +++ b/homeassistant/components/lutron_caseta/__init__.py @@ -528,7 +528,9 @@ def _async_subscribe_keypad_events( button_type=button_type, action=action, ) - async_dispatcher_send(f"{DOMAIN}_{config_entry_id}_button_{button_id}", data) + async_dispatcher_send( + hass, f"{DOMAIN}_{config_entry_id}_button_{button_id}", data + ) hass.bus.async_fire(LUTRON_CASETA_BUTTON_EVENT, data) for button_id in keypad_buttons: diff --git a/homeassistant/components/lutron_caseta/event.py b/homeassistant/components/lutron_caseta/event.py index eadc9e1f6ac..de276df2d16 100644 --- a/homeassistant/components/lutron_caseta/event.py +++ b/homeassistant/components/lutron_caseta/event.py @@ -2,7 +2,7 @@ from __future__ import annotations -from homeassistant.components.event import EventEntity +from homeassistant.components.event import EventDeviceClass, EventEntity from homeassistant.core import HomeAssistant from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.helpers.entity_platform import AddEntitiesCallback @@ -25,7 +25,7 @@ async def async_setup_entry( """Set up Lutron pico and keypad buttons.""" data = config_entry.runtime_data async_add_entities( - LutronCasetaButtonEvent(data, config_entry.entry_id, button_device) + LutronCasetaButtonEvent(data, button_device, config_entry.entry_id) for button_device in data.button_devices ) @@ -33,6 +33,8 @@ async def async_setup_entry( class LutronCasetaButtonEvent(LutronCasetaDevice, EventEntity): """Representation of a Lutron pico and keypad button event.""" + _attr_device_class = EventDeviceClass.BUTTON + def __init__( self, data: LutronCasetaData,