diff --git a/homeassistant/components/technove/binary_sensor.py b/homeassistant/components/technove/binary_sensor.py index 1ecefe6f85c..f231e206c96 100644 --- a/homeassistant/components/technove/binary_sensor.py +++ b/homeassistant/components/technove/binary_sensor.py @@ -4,28 +4,19 @@ from __future__ import annotations from collections.abc import Callable from dataclasses import dataclass -from typing import TYPE_CHECKING from technove import Station as TechnoVEStation from homeassistant.components.binary_sensor import ( - DOMAIN as BINARY_SENSOR_DOMAIN, BinarySensorDeviceClass, BinarySensorEntity, BinarySensorEntityDescription, ) from homeassistant.const import EntityCategory from homeassistant.core import HomeAssistant -from homeassistant.helpers import entity_registry as er from homeassistant.helpers.entity_platform import AddEntitiesCallback -from homeassistant.helpers.issue_registry import ( - IssueSeverity, - async_create_issue, - async_delete_issue, -) from . import TechnoVEConfigEntry -from .const import DOMAIN from .coordinator import TechnoVEDataUpdateCoordinator from .entity import TechnoVEEntity @@ -34,7 +25,6 @@ from .entity import TechnoVEEntity class TechnoVEBinarySensorDescription(BinarySensorEntityDescription): """Describes TechnoVE binary sensor entity.""" - deprecated_version: str | None = None value_fn: Callable[[TechnoVEStation], bool | None] @@ -57,15 +47,6 @@ BINARY_SENSORS = [ entity_category=EntityCategory.DIAGNOSTIC, value_fn=lambda station: station.info.is_battery_protected, ), - TechnoVEBinarySensorDescription( - key="is_session_active", - entity_category=EntityCategory.DIAGNOSTIC, - device_class=BinarySensorDeviceClass.BATTERY_CHARGING, - value_fn=lambda station: station.info.is_session_active, - deprecated_version="2025.2.0", - # Disabled by default, as this entity is deprecated - entity_registry_enabled_default=False, - ), TechnoVEBinarySensorDescription( key="is_static_ip", translation_key="is_static_ip", @@ -113,34 +94,3 @@ class TechnoVEBinarySensorEntity(TechnoVEEntity, BinarySensorEntity): """Return the state of the sensor.""" return self.entity_description.value_fn(self.coordinator.data) - - async def async_added_to_hass(self) -> None: - """Raise issue when entity is registered and was not disabled.""" - if TYPE_CHECKING: - assert self.unique_id - if entity_id := er.async_get(self.hass).async_get_entity_id( - BINARY_SENSOR_DOMAIN, DOMAIN, self.unique_id - ): - if self.enabled and self.entity_description.deprecated_version: - async_create_issue( - self.hass, - DOMAIN, - f"deprecated_entity_{self.entity_description.key}", - breaks_in_ha_version=self.entity_description.deprecated_version, - is_fixable=False, - severity=IssueSeverity.WARNING, - translation_key=f"deprecated_entity_{self.entity_description.key}", - translation_placeholders={ - "sensor_name": self.name - if isinstance(self.name, str) - else entity_id, - "entity": entity_id, - }, - ) - else: - async_delete_issue( - self.hass, - DOMAIN, - f"deprecated_entity_{self.entity_description.key}", - ) - await super().async_added_to_hass() diff --git a/homeassistant/components/technove/strings.json b/homeassistant/components/technove/strings.json index 7175b7c2de5..9976f0b3c59 100644 --- a/homeassistant/components/technove/strings.json +++ b/homeassistant/components/technove/strings.json @@ -90,11 +90,5 @@ "set_charging_enabled_on_auto_charge": { "message": "Cannot enable or disable charging when auto-charge is enabled. Try disabling auto-charge first." } - }, - "issues": { - "deprecated_entity_is_session_active": { - "title": "The TechnoVE {sensor_name} binary sensor is deprecated", - "description": "`{entity}` is deprecated.\nPlease update your automations and scripts to replace the binary sensor entity with the newly added switch entity.\nWhen you are done migrating you can disable `{entity}`." - } } } diff --git a/tests/components/technove/snapshots/test_binary_sensor.ambr b/tests/components/technove/snapshots/test_binary_sensor.ambr index cc2dcf4a04a..f08dd6970fe 100644 --- a/tests/components/technove/snapshots/test_binary_sensor.ambr +++ b/tests/components/technove/snapshots/test_binary_sensor.ambr @@ -45,53 +45,6 @@ 'state': 'off', }) # --- -# name: test_sensors[binary_sensor.technove_station_charging-entry] - EntityRegistryEntrySnapshot({ - 'aliases': set({ - }), - 'area_id': None, - 'capabilities': None, - 'config_entry_id': , - 'device_class': None, - 'device_id': , - 'disabled_by': None, - 'domain': 'binary_sensor', - 'entity_category': , - 'entity_id': 'binary_sensor.technove_station_charging', - 'has_entity_name': True, - 'hidden_by': None, - 'icon': None, - 'id': , - 'labels': set({ - }), - 'name': None, - 'options': dict({ - }), - 'original_device_class': , - 'original_icon': None, - 'original_name': 'Charging', - 'platform': 'technove', - 'previous_unique_id': None, - 'supported_features': 0, - 'translation_key': None, - 'unique_id': 'AA:AA:AA:AA:AA:BB_is_session_active', - 'unit_of_measurement': None, - }) -# --- -# name: test_sensors[binary_sensor.technove_station_charging-state] - StateSnapshot({ - 'attributes': ReadOnlyDict({ - 'device_class': 'battery_charging', - 'friendly_name': 'TechnoVE Station Charging', - }), - 'context': , - 'entity_id': 'binary_sensor.technove_station_charging', - 'last_changed': , - 'last_reported': , - 'last_updated': , - 'state': 'on', - }) -# --- # name: test_sensors[binary_sensor.technove_station_conflict_with_power_sharing_mode-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ diff --git a/tests/components/technove/test_binary_sensor.py b/tests/components/technove/test_binary_sensor.py index 0a90093779e..93d4805cecb 100644 --- a/tests/components/technove/test_binary_sensor.py +++ b/tests/components/technove/test_binary_sensor.py @@ -45,7 +45,6 @@ async def test_sensors( "entity_id", [ "binary_sensor.technove_station_static_ip", - "binary_sensor.technove_station_charging", ], ) @pytest.mark.usefixtures("init_integration")