diff --git a/homeassistant/components/habitica/sensor.py b/homeassistant/components/habitica/sensor.py index df7e8feeaf8..00775c32d16 100644 --- a/homeassistant/components/habitica/sensor.py +++ b/homeassistant/components/habitica/sensor.py @@ -17,11 +17,6 @@ from homeassistant.const import CONF_NAME, CONF_URL from homeassistant.core import HomeAssistant from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo from homeassistant.helpers.entity_platform import AddEntitiesCallback -from homeassistant.helpers.issue_registry import ( - IssueSeverity, - async_create_issue, - async_delete_issue, -) from .const import DOMAIN, MANUFACTURER, NAME @@ -172,9 +167,8 @@ async def async_setup_entry( HabitipySensor(sensor_data, description, config_entry) for description in SENSOR_DESCRIPTIONS.values() ] - # Task sensors are deprecated and will be removed in 2024.12 entities.extend( - HabitipyTaskSensor(hass, name, task_type, sensor_data, config_entry) + HabitipyTaskSensor(name, task_type, sensor_data, config_entry) for task_type in TASKS_TYPES ) async_add_entities(entities, True) @@ -216,39 +210,12 @@ class HabitipySensor(SensorEntity): data = data[element] self._attr_native_value = data - async def async_added_to_hass(self) -> None: - """Raise issue when entity is registered and was not disabled.""" - if self.entity_description.key == HabitipySensorEntity.HEALTH_MAX: - if self.enabled: - name = self.name - async_create_issue( - self.hass, - DOMAIN, - f"deprecated_sensor_entity_{self.entity_description.key}", - breaks_in_ha_version="2024.12.0", - is_fixable=False, - severity=IssueSeverity.WARNING, - translation_key="deprecated_sensor_entity", - translation_placeholders={ - "entity_name": str(name), - "entity": self.entity_id, - }, - ) - else: - async_delete_issue( - self.hass, - DOMAIN, - f"deprecated_sensor_entity_{self.entity_description.key}", - ) - -# Task sensors are deprecated and will be removed in 2024.12 class HabitipyTaskSensor(SensorEntity): """A Habitica task sensor.""" - def __init__(self, hass, name, task_name, updater, entry): + def __init__(self, name, task_name, updater, entry): """Initialize a generic Habitica task.""" - # self.hass = hass self._name = name self._task_name = task_name self._task_type = TASKS_TYPES[task_name] @@ -272,29 +239,6 @@ class HabitipyTaskSensor(SensorEntity): tasks_length = len(all_tasks[element]) self._state = tasks_length - async def async_added_to_hass(self) -> None: - """Raise issue when entity is registered and was not disabled.""" - if self.enabled: - async_create_issue( - self.hass, - DOMAIN, - f"deprecated_task_entity_{self._task_name}", - breaks_in_ha_version="2024.12.0", - is_fixable=False, - severity=IssueSeverity.WARNING, - translation_key="deprecated_task_entity", - translation_placeholders={ - "task_name": self._task_name, - "entity": f"sensor.habitica_{self._name}_{self._task_name}", - }, - ) - else: - async_delete_issue( - self.hass, - DOMAIN, - f"deprecated_task_entity_{self._task_name}", - ) - @property def icon(self): """Return the icon to use in the frontend, if any.""" diff --git a/homeassistant/components/habitica/strings.json b/homeassistant/components/habitica/strings.json index 1e43b4bc6ae..6099f8d8779 100644 --- a/homeassistant/components/habitica/strings.json +++ b/homeassistant/components/habitica/strings.json @@ -59,16 +59,6 @@ } } }, - "issues": { - "deprecated_task_entity": { - "title": "The Habitica `{task_name}` sensor is deprecated", - "description": "The Habitica entity `{entity}` is deprecated and will be removed in `2024.12`.\nPlease update your automations and scripts to replace the sensor entity with the new todo entity.\nWhen you are done migrating you can disable the entity." - }, - "deprecated_sensor_entity": { - "title": "The Habitica `{entity_name}` sensor is deprecated", - "description": "The Habitica entity `{entity}` is deprecated and will be removed in `2024.12`.\nEach player can have a maximum of 50 HP, and this maximum cannot be altered, thus the `{entity_name}` sensor serves no purpose.\nYou can disable the entity." - } - }, "services": { "api_call": { "name": "API name",