Use the action field enums in huawei_lte (#195770)

This commit is contained in:
epenet
2026-12-01 10:24:35 +00:00
committed by GitHub
parent aa8beb24e0
commit ed0453a7d8
@@ -5,7 +5,10 @@ from typing import Any, override
from huawei_lte_api.exceptions import ResponseErrorException
from homeassistant.components.notify import ATTR_TARGET, BaseNotificationService
from homeassistant.components.notify import (
BaseNotificationService,
NotifyServiceArgument,
)
from homeassistant.const import ATTR_CONFIG_ENTRY_ID, CONF_RECIPIENT
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError
@@ -48,7 +51,7 @@ class HuaweiLteSmsNotificationService(BaseNotificationService):
def send_message(self, message: str = "", **kwargs: Any) -> None:
"""Send message to target numbers."""
targets = kwargs.get(ATTR_TARGET, self.default_targets)
targets = kwargs.get(NotifyServiceArgument.TARGET, self.default_targets)
if not targets or not message:
return