diff --git a/homeassistant/components/sun/icons.json b/homeassistant/components/sun/icons.json index 9de555aca06efc..1aacd21efaeaa7 100644 --- a/homeassistant/components/sun/icons.json +++ b/homeassistant/components/sun/icons.json @@ -33,9 +33,6 @@ }, "solar_elevation": { "default": "mdi:theme-light-dark" - }, - "solar_rising": { - "default": "mdi:sun-clock" } } } diff --git a/homeassistant/components/sun/sensor.py b/homeassistant/components/sun/sensor.py index 9c219d78efca0c..3e2b6fdf6ed706 100644 --- a/homeassistant/components/sun/sensor.py +++ b/homeassistant/components/sun/sensor.py @@ -18,11 +18,6 @@ from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback -from homeassistant.helpers.issue_registry import ( - IssueSeverity, - async_create_issue, - async_delete_issue, -) from homeassistant.helpers.typing import StateType from .const import DOMAIN, SIGNAL_EVENTS_CHANGED, SIGNAL_POSITION_CHANGED @@ -100,13 +95,6 @@ class SunSensorEntityDescription(SensorEntityDescription): native_unit_of_measurement=DEGREE, signal=SIGNAL_POSITION_CHANGED, ), - SunSensorEntityDescription( - key="solar_rising", - translation_key="solar_rising", - value_fn=lambda data: data.rising, - entity_registry_enabled_default=False, - signal=SIGNAL_EVENTS_CHANGED, - ), ) @@ -155,20 +143,6 @@ async def async_added_to_hass(self) -> None: """Register signal listener when added to hass.""" await super().async_added_to_hass() - if self.entity_description.key == "solar_rising": - async_create_issue( - self.hass, - DOMAIN, - "deprecated_sun_solar_rising", - breaks_in_ha_version="2026.1.0", - is_fixable=False, - severity=IssueSeverity.WARNING, - translation_key="deprecated_sun_solar_rising", - translation_placeholders={ - "entity": self.entity_id, - }, - ) - self.async_on_remove( async_dispatcher_connect( self.hass, @@ -176,9 +150,3 @@ async def async_added_to_hass(self) -> None: self.async_write_ha_state, ) ) - - async def async_will_remove_from_hass(self) -> None: - """Call when entity will be removed from hass.""" - await super().async_will_remove_from_hass() - if self.entity_description.key == "solar_rising": - async_delete_issue(self.hass, DOMAIN, "deprecated_sun_solar_rising") diff --git a/homeassistant/components/sun/strings.json b/homeassistant/components/sun/strings.json index e9fafe36aef006..2b331f6cff5d09 100644 --- a/homeassistant/components/sun/strings.json +++ b/homeassistant/components/sun/strings.json @@ -24,8 +24,7 @@ "next_rising": { "name": "Next rising" }, "next_setting": { "name": "Next setting" }, "solar_azimuth": { "name": "Solar azimuth" }, - "solar_elevation": { "name": "Solar elevation" }, - "solar_rising": { "name": "Solar rising" } + "solar_elevation": { "name": "Solar elevation" } } }, "entity_component": { @@ -37,11 +36,5 @@ } } }, - "issues": { - "deprecated_sun_solar_rising": { - "description": "The 'Solar rising' sensor of the Sun integration is being deprecated; an equivalent 'Solar rising' binary sensor has been made available as a replacement. To resolve this issue, disable {entity}.", - "title": "Deprecated 'Solar rising' sensor" - } - }, "title": "Sun" } diff --git a/tests/components/sun/test_sensor.py b/tests/components/sun/test_sensor.py index 95f4364f775064..fc56fc1737b6f3 100644 --- a/tests/components/sun/test_sensor.py +++ b/tests/components/sun/test_sensor.py @@ -8,15 +8,12 @@ import pytest from homeassistant.components import sun -from homeassistant.config_entries import RELOAD_AFTER_UPDATE_DELAY from homeassistant.const import EntityCategory from homeassistant.core import HomeAssistant -from homeassistant.helpers import entity_registry as er, issue_registry as ir +from homeassistant.helpers import entity_registry as er from homeassistant.setup import async_setup_component from homeassistant.util import dt as dt_util -from tests.common import async_fire_time_changed - @pytest.mark.usefixtures("entity_registry_enabled_by_default") async def test_setting_rising( @@ -177,51 +174,3 @@ async def test_setting_rising( assert entity assert entity.entity_category is EntityCategory.DIAGNOSTIC assert entity.unique_id == f"{entry_ids[0].entry_id}-solar_azimuth" - - entity = entity_registry.async_get("sensor.sun_solar_rising") - assert entity - assert entity.entity_category is EntityCategory.DIAGNOSTIC - assert entity.unique_id == f"{entry_ids[0].entry_id}-solar_rising" - - -@pytest.mark.usefixtures("entity_registry_enabled_by_default") -async def test_deprecation( - hass: HomeAssistant, - entity_registry: er.EntityRegistry, - issue_registry: ir.IssueRegistry, - freezer: FrozenDateTimeFactory, -) -> None: - """Test sensor.sun_solar_rising deprecation.""" - utc_now = datetime(2016, 11, 1, 8, 0, 0, tzinfo=dt_util.UTC) - freezer.move_to(utc_now) - await async_setup_component(hass, sun.DOMAIN, {sun.DOMAIN: {}}) - await hass.async_block_till_done() - - assert issue_registry.async_get_issue( - domain="sun", - issue_id="deprecated_sun_solar_rising", - ) - assert len(issue_registry.issues) == 1 - - entity_registry.async_update_entity( - "sensor.sun_solar_rising", disabled_by=er.RegistryEntryDisabler.USER - ) - await hass.async_block_till_done() - - assert not issue_registry.async_get_issue( - domain="sun", - issue_id="deprecated_sun_solar_rising", - ) - assert len(issue_registry.issues) == 0 - - entity_registry.async_update_entity("sensor.sun_solar_rising", disabled_by=None) - await hass.async_block_till_done() - freezer.tick(delta=RELOAD_AFTER_UPDATE_DELAY) - async_fire_time_changed(hass) - await hass.async_block_till_done() - - assert issue_registry.async_get_issue( - domain="sun", - issue_id="deprecated_sun_solar_rising", - ) - assert len(issue_registry.issues) == 1