Apply suggestions from code review

This commit is contained in:
Erik
2025-05-27 13:23:21 +02:00
parent af57077705
commit 0314955c5a
3 changed files with 6 additions and 6 deletions
+2 -6
View File
@@ -4,13 +4,9 @@ from __future__ import annotations
from homeassistant.core import HomeAssistant
from homeassistant.helpers.trigger import Trigger
from homeassistant.util.decorator import Registry
from .triggers import event, value_updated
TRIGGERS = {
event.PLATFORM_TYPE: event.EventTrigger,
value_updated.PLATFORM_TYPE: value_updated.ValueUpdatedTrigger,
}
TRIGGERS: Registry[str, type[Trigger]] = Registry()
async def async_get_triggers(hass: HomeAssistant) -> dict[str, type[Trigger]]:
@@ -34,6 +34,7 @@ from ..helpers import (
get_device_id,
get_home_and_node_id_from_device_entry,
)
from ..trigger import TRIGGERS
from .trigger_helpers import async_bypass_dynamic_config_validation
# Platform type should be <DOMAIN>.<SUBMODULE_NAME>
@@ -253,6 +254,7 @@ async def async_attach_trigger(
return async_remove
@TRIGGERS.register(PLATFORM_TYPE)
class EventTrigger(Trigger):
"""Z-Wave JS event trigger."""
@@ -35,6 +35,7 @@ from ..const import (
EVENT_VALUE_UPDATED,
)
from ..helpers import async_get_nodes_from_targets, get_device_id
from ..trigger import TRIGGERS
from .trigger_helpers import async_bypass_dynamic_config_validation
# Platform type should be <DOMAIN>.<SUBMODULE_NAME>
@@ -204,6 +205,7 @@ async def async_attach_trigger(
return async_remove
@TRIGGERS.register(PLATFORM_TYPE)
class ValueUpdatedTrigger(Trigger):
"""Z-Wave JS value updated trigger."""