From c8aabc48f1e4285cad5f461f266d9458e5d809d4 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Tue, 28 Dec 2021 21:20:10 +0100 Subject: [PATCH] Deprecate Time of Flight (ADR-0019) (#62955) --- homeassistant/components/tof/sensor.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/tof/sensor.py b/homeassistant/components/tof/sensor.py index 631018f55cd..0a921665bdb 100644 --- a/homeassistant/components/tof/sensor.py +++ b/homeassistant/components/tof/sensor.py @@ -1,7 +1,7 @@ """Platform for Time of Flight sensor VL53L1X from STMicroelectronics.""" - import asyncio from functools import partial +import logging from VL53L1X2 import VL53L1X # pylint: disable=import-error import voluptuous as vol @@ -30,6 +30,8 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( } ) +_LOGGER = logging.getLogger(__name__) + def init_tof_0(xshut, sensor): """XSHUT port LOW resets the device.""" @@ -46,6 +48,12 @@ def init_tof_1(xshut): async def async_setup_platform(hass, config, async_add_entities, discovery_info=None): """Reset and initialize the VL53L1X ToF Sensor from STMicroelectronics.""" + _LOGGER.warning( + "The Time of Flight 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" + ) name = config.get(CONF_NAME) bus_number = config.get(CONF_I2C_BUS)