Deprecate Sense HAT (ADR-0019) (#63500)

This commit is contained in:
Franck Nijhof 2022-01-05 19:34:45 +01:00 committed by GitHub
parent d0d5222bf4
commit 640e625c2c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View file

@ -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()

View file

@ -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 = [