mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 16:17:20 +00:00
lint
This commit is contained in:
parent
581efad5a7
commit
93fe46509f
@ -528,7 +528,9 @@ def _async_subscribe_keypad_events(
|
|||||||
button_type=button_type,
|
button_type=button_type,
|
||||||
action=action,
|
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)
|
hass.bus.async_fire(LUTRON_CASETA_BUTTON_EVENT, data)
|
||||||
|
|
||||||
for button_id in keypad_buttons:
|
for button_id in keypad_buttons:
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from homeassistant.components.event import EventEntity
|
from homeassistant.components.event import EventDeviceClass, EventEntity
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
@ -25,7 +25,7 @@ async def async_setup_entry(
|
|||||||
"""Set up Lutron pico and keypad buttons."""
|
"""Set up Lutron pico and keypad buttons."""
|
||||||
data = config_entry.runtime_data
|
data = config_entry.runtime_data
|
||||||
async_add_entities(
|
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
|
for button_device in data.button_devices
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -33,6 +33,8 @@ async def async_setup_entry(
|
|||||||
class LutronCasetaButtonEvent(LutronCasetaDevice, EventEntity):
|
class LutronCasetaButtonEvent(LutronCasetaDevice, EventEntity):
|
||||||
"""Representation of a Lutron pico and keypad button event."""
|
"""Representation of a Lutron pico and keypad button event."""
|
||||||
|
|
||||||
|
_attr_device_class = EventDeviceClass.BUTTON
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
data: LutronCasetaData,
|
data: LutronCasetaData,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user