1
0
mirror of https://github.com/home-assistant/core.git synced 2026-02-15 07:36:16 +00:00

Deprecate implicit Wake-On-LAN in Samsung TV integration (#158740)

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
This commit is contained in:
Paul Tarjan
2026-01-27 11:36:43 -07:00
committed by GitHub
parent eaa1798443
commit 364ecc191e
3 changed files with 22 additions and 5 deletions

View File

@@ -14,7 +14,7 @@ from homeassistant.const import (
CONF_MODEL,
)
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers import device_registry as dr
from homeassistant.helpers import device_registry as dr, issue_registry as ir
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.trigger import PluggableAction
@@ -24,6 +24,8 @@ from .const import CONF_MANUFACTURER, DOMAIN, LOGGER
from .coordinator import SamsungTVDataUpdateCoordinator
from .triggers.turn_on import async_get_turn_on_trigger
DEPRECATED_IMPLICIT_WAKE_ON_LAN = "deprecated_implicit_wake_on_lan_{}"
class SamsungTVEntity(CoordinatorEntity[SamsungTVDataUpdateCoordinator], Entity):
"""Defines a base SamsungTV entity."""
@@ -92,9 +94,18 @@ class SamsungTVEntity(CoordinatorEntity[SamsungTVDataUpdateCoordinator], Entity)
LOGGER.debug("Attempting to turn on %s via automation", self.entity_id)
await self._turn_on_action.async_run(self.hass, self._context)
elif self._mac:
LOGGER.debug(
"Attempting to turn on %s via Wake-On-Lan",
self.entity_id,
ir.async_create_issue(
self.hass,
DOMAIN,
DEPRECATED_IMPLICIT_WAKE_ON_LAN.format(self._mac),
is_fixable=False,
breaks_in_ha_version="2026.8.0",
severity=ir.IssueSeverity.WARNING,
translation_key="deprecated_implicit_wake_on_lan",
translation_placeholders={
"mac_address": self._mac,
"wol_documentation_url": "https://www.home-assistant.io/integrations/wake_on_lan/",
},
)
await self.hass.async_add_executor_job(self._wake_on_lan)
else:

View File

@@ -97,7 +97,7 @@ class SamsungTVDevice(SamsungTVEntity, MediaPlayerEntity):
self._attr_supported_features = SUPPORT_SAMSUNGTV
if self._mac:
# (deprecated) add turn-on if mac is available
# Deprecated: Implicit Wake-On-LAN, will be removed in 2026.8.0
# Triggers have not yet been registered so this is adjusted in the property
self._attr_supported_features |= MediaPlayerEntityFeature.TURN_ON
if self._ssdp_rendering_control_location:

View File

@@ -80,5 +80,11 @@
"unhandled_trigger_type": {
"message": "Unhandled trigger type {trigger_type}."
}
},
"issues": {
"deprecated_implicit_wake_on_lan": {
"description": "Implicit Wake-On-LAN is deprecated and will be removed in a future version of Home Assistant. Please create an explicit Wake-On-LAN automation to turn on your TV, targeting MAC address `{mac_address}`.\n\nFor more information, see the [Wake-On-LAN documentation]({wol_documentation_url}).",
"title": "Implicit Wake-On-LAN is deprecated"
}
}
}