From 72d1b3e36093e2e93a97f41392d5891a5255475c Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Mon, 24 Jun 2024 21:05:23 +0200 Subject: [PATCH] Deprecate Nanoleaf gesture device trigger (#120078) --- homeassistant/components/nanoleaf/device_trigger.py | 10 ++++++++++ homeassistant/components/nanoleaf/strings.json | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/homeassistant/components/nanoleaf/device_trigger.py b/homeassistant/components/nanoleaf/device_trigger.py index 15b14e9719e..b4049f2199d 100644 --- a/homeassistant/components/nanoleaf/device_trigger.py +++ b/homeassistant/components/nanoleaf/device_trigger.py @@ -16,6 +16,7 @@ from homeassistant.const import ( ) from homeassistant.core import CALLBACK_TYPE, HomeAssistant from homeassistant.helpers import device_registry as dr +from homeassistant.helpers.issue_registry import IssueSeverity, async_create_issue from homeassistant.helpers.trigger import TriggerActionType, TriggerInfo from homeassistant.helpers.typing import ConfigType @@ -60,6 +61,15 @@ async def async_attach_trigger( trigger_info: TriggerInfo, ) -> CALLBACK_TYPE: """Attach a trigger.""" + async_create_issue( + hass, + DOMAIN, + "deprecated_device_trigger_nanoleaf", + is_fixable=False, + breaks_in_ha_version="2025.1.0", + severity=IssueSeverity.WARNING, + translation_key="deprecated_device_trigger", + ) event_config = event_trigger.TRIGGER_SCHEMA( { event_trigger.CONF_PLATFORM: CONF_EVENT, diff --git a/homeassistant/components/nanoleaf/strings.json b/homeassistant/components/nanoleaf/strings.json index 40cd7294ec3..ef7df8c0ab5 100644 --- a/homeassistant/components/nanoleaf/strings.json +++ b/homeassistant/components/nanoleaf/strings.json @@ -52,5 +52,11 @@ } } } + }, + "issues": { + "deprecated_device_trigger": { + "title": "Nanoleaf device trigger is deprecated", + "description": "The Nanoleaf device trigger is deprecated and will be removed in a future release. You can now use the gesture event entity to build automations." + } } }