From 640e625c2c987d6f34ab2e3c232712465e3e42b0 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Wed, 5 Jan 2022 19:34:45 +0100 Subject: [PATCH] Deprecate Sense HAT (ADR-0019) (#63500) --- homeassistant/components/sensehat/light.py | 10 ++++++++++ homeassistant/components/sensehat/sensor.py | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/homeassistant/components/sensehat/light.py b/homeassistant/components/sensehat/light.py index 38bb81bac0c..c1184576362 100644 --- a/homeassistant/components/sensehat/light.py +++ b/homeassistant/components/sensehat/light.py @@ -1,6 +1,8 @@ """Support for Sense Hat LEDs.""" from __future__ import annotations +import logging + from sense_hat import SenseHat import voluptuous as vol @@ -27,6 +29,8 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( {vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string} ) +_LOGGER = logging.getLogger(__name__) + def setup_platform( hass: HomeAssistant, @@ -35,6 +39,12 @@ def setup_platform( discovery_info: DiscoveryInfoType | None = None, ) -> None: """Set up the Sense Hat Light platform.""" + _LOGGER.warning( + "The Sense HAT integration is deprecated and will be removed " + "in Home Assistant Core 2022.4; this integration is removed under " + "Architectural Decision Record 0019, more information can be found here: " + "https://github.com/home-assistant/architecture/blob/master/adr/0019-GPIO.md" + ) sensehat = SenseHat() diff --git a/homeassistant/components/sensehat/sensor.py b/homeassistant/components/sensehat/sensor.py index 3a66c402b12..bf9d77104da 100644 --- a/homeassistant/components/sensehat/sensor.py +++ b/homeassistant/components/sensehat/sensor.py @@ -91,6 +91,12 @@ def setup_platform( discovery_info: DiscoveryInfoType | None = None, ) -> None: """Set up the Sense HAT sensor platform.""" + _LOGGER.warning( + "The Sense HAT integration is deprecated and will be removed " + "in Home Assistant Core 2022.4; this integration is removed under " + "Architectural Decision Record 0019, more information can be found here: " + "https://github.com/home-assistant/architecture/blob/master/adr/0019-GPIO.md" + ) data = SenseHatData(config.get(CONF_IS_HAT_ATTACHED)) display_options = config[CONF_DISPLAY_OPTIONS] entities = [