Adjust device_automation type hints in rfxtrx (#72138)
This commit is contained in:
parent
6ec755a79d
commit
dfc8dee2d6
2 changed files with 20 additions and 8 deletions
|
@ -47,13 +47,15 @@ TRIGGER_SCHEMA = DEVICE_TRIGGER_BASE_SCHEMA.extend(
|
|||
)
|
||||
|
||||
|
||||
async def async_get_triggers(hass: HomeAssistant, device_id: str) -> list[dict]:
|
||||
async def async_get_triggers(
|
||||
hass: HomeAssistant, device_id: str
|
||||
) -> list[dict[str, str]]:
|
||||
"""List device triggers for RFXCOM RFXtrx devices."""
|
||||
device = async_get_device_object(hass, device_id)
|
||||
|
||||
triggers = []
|
||||
for conf_type in TRIGGER_TYPES:
|
||||
data = getattr(device, TRIGGER_SELECTION[conf_type], {})
|
||||
data: dict[int, str] = getattr(device, TRIGGER_SELECTION[conf_type], {})
|
||||
for command in data.values():
|
||||
triggers.append(
|
||||
{
|
||||
|
@ -67,7 +69,9 @@ async def async_get_triggers(hass: HomeAssistant, device_id: str) -> list[dict]:
|
|||
return triggers
|
||||
|
||||
|
||||
async def async_validate_trigger_config(hass, config):
|
||||
async def async_validate_trigger_config(
|
||||
hass: HomeAssistant, config: ConfigType
|
||||
) -> ConfigType:
|
||||
"""Validate config."""
|
||||
config = TRIGGER_SCHEMA(config)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue