diff --git a/homeassistant/components/ring/__init__.py b/homeassistant/components/ring/__init__.py index 88c7467af91b65..2901a904dc4bf1 100644 --- a/homeassistant/components/ring/__init__.py +++ b/homeassistant/components/ring/__init__.py @@ -11,14 +11,13 @@ from homeassistant.config_entries import ConfigEntry from homeassistant.const import APPLICATION_NAME, CONF_TOKEN -from homeassistant.core import HomeAssistant, ServiceCall, callback +from homeassistant.core import HomeAssistant, callback from homeassistant.helpers import ( device_registry as dr, entity_registry as er, instance_id, ) from homeassistant.helpers.aiohttp_client import async_get_clientsession -from homeassistant.helpers.issue_registry import IssueSeverity, async_create_issue from .const import CONF_LISTEN_CREDENTIALS, DOMAIN, PLATFORMS from .coordinator import RingDataCoordinator, RingListenCoordinator @@ -103,30 +102,6 @@ def listen_credentials_updater(token: dict[str, Any]) -> None: if hass.services.has_service(DOMAIN, "update"): return True - async def async_refresh_all(_: ServiceCall) -> None: - """Refresh all ring data.""" - _LOGGER.warning( - "Detected use of service 'ring.update'. " - "This is deprecated and will stop working in Home Assistant 2024.10. " - "Use 'homeassistant.update_entity' instead which updates all ring entities", - ) - async_create_issue( - hass, - DOMAIN, - "deprecated_service_ring_update", - breaks_in_ha_version="2024.10.0", - is_fixable=True, - is_persistent=False, - issue_domain=DOMAIN, - severity=IssueSeverity.WARNING, - translation_key="deprecated_service_ring_update", - ) - for loaded_entry in hass.config_entries.async_loaded_entries(DOMAIN): - await loaded_entry.runtime_data.devices_coordinator.async_refresh() - - # register service - hass.services.async_register(DOMAIN, "update", async_refresh_all) - return True diff --git a/homeassistant/components/ring/services.yaml b/homeassistant/components/ring/services.yaml deleted file mode 100644 index 91b8669505b380..00000000000000 --- a/homeassistant/components/ring/services.yaml +++ /dev/null @@ -1 +0,0 @@ -update: diff --git a/homeassistant/components/ring/strings.json b/homeassistant/components/ring/strings.json index 80598eab314a84..142b83ab51ab4f 100644 --- a/homeassistant/components/ring/strings.json +++ b/homeassistant/components/ring/strings.json @@ -98,24 +98,7 @@ } } }, - "services": { - "update": { - "name": "Update", - "description": "Updates the data we have for all your ring devices." - } - }, "issues": { - "deprecated_service_ring_update": { - "title": "Detected use of deprecated action `ring.update`", - "fix_flow": { - "step": { - "confirm": { - "title": "[%key:component::ring::issues::deprecated_service_ring_update::title%]", - "description": "Use `homeassistant.update_entity` instead which will update all ring entities.\n\nPlease replace uses of this action and adjust your automations and scripts and select **submit** to close this issue." - } - } - } - }, "deprecated_entity": { "title": "Detected deprecated `{platform}` entity usage", "description": "We detected that entity `{entity}` is being used in `{info}`\n\nWe have created a new `{new_platform}` entity and you should migrate `{info}` to use this new entity.\n\nWhen you are done migrating `{info}` and are ready to have the deprecated `{entity}` entity removed, disable the entity and restart Home Assistant." diff --git a/tests/components/ring/test_camera.py b/tests/components/ring/test_camera.py index 619fb52846c39a..245c4ce6228efe 100644 --- a/tests/components/ring/test_camera.py +++ b/tests/components/ring/test_camera.py @@ -138,25 +138,6 @@ def _has_capability(capability): ) -async def test_updates_work( - hass: HomeAssistant, mock_ring_client, mock_ring_devices -) -> None: - """Tests the update service works correctly.""" - await setup_platform(hass, Platform.CAMERA) - state = hass.states.get("camera.internal") - assert state.attributes.get("motion_detection") is True - - internal_camera_mock = mock_ring_devices.get_device(345678) - internal_camera_mock.motion_detection = False - - await hass.services.async_call("ring", "update", {}, blocking=True) - - await hass.async_block_till_done() - - state = hass.states.get("camera.internal") - assert state.attributes.get("motion_detection") is not True - - @pytest.mark.parametrize( ("exception_type", "reauth_expected"), [ diff --git a/tests/components/ring/test_init.py b/tests/components/ring/test_init.py index 10d183a22e97f5..5ac9e444ccae42 100644 --- a/tests/components/ring/test_init.py +++ b/tests/components/ring/test_init.py @@ -14,7 +14,7 @@ from homeassistant.config_entries import SOURCE_REAUTH, ConfigEntryState from homeassistant.const import CONF_TOKEN, CONF_USERNAME 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 .device_mocks import FRONT_DOOR_DEVICE_ID @@ -233,33 +233,6 @@ async def test_error_on_device_update( assert hass.config_entries.async_get_entry(mock_config_entry.entry_id) -async def test_issue_deprecated_service_ring_update( - hass: HomeAssistant, - issue_registry: ir.IssueRegistry, - caplog: pytest.LogCaptureFixture, - mock_ring_client, - mock_config_entry: MockConfigEntry, -) -> None: - """Test the issue is raised on deprecated service ring.update.""" - mock_config_entry.add_to_hass(hass) - await hass.config_entries.async_setup(mock_config_entry.entry_id) - await hass.async_block_till_done() - - await hass.services.async_call(DOMAIN, "update", {}, blocking=True) - - issue = issue_registry.async_get_issue("ring", "deprecated_service_ring_update") - assert issue - assert issue.issue_domain == "ring" - assert issue.issue_id == "deprecated_service_ring_update" - assert issue.translation_key == "deprecated_service_ring_update" - - assert ( - "Detected use of service 'ring.update'. " - "This is deprecated and will stop working in Home Assistant 2024.10. " - "Use 'homeassistant.update_entity' instead which updates all ring entities" - ) in caplog.text - - @pytest.mark.parametrize( ("domain", "old_unique_id"), [ diff --git a/tests/components/ring/test_light.py b/tests/components/ring/test_light.py index 22ed4a31cf819e..8ac47ac2f1d875 100644 --- a/tests/components/ring/test_light.py +++ b/tests/components/ring/test_light.py @@ -65,25 +65,6 @@ async def test_light_can_be_turned_on(hass: HomeAssistant, mock_ring_client) -> assert state.state == "on" -async def test_updates_work( - hass: HomeAssistant, mock_ring_client, mock_ring_devices -) -> None: - """Tests the update service works correctly.""" - await setup_platform(hass, Platform.LIGHT) - state = hass.states.get("light.front_light") - assert state.state == "off" - - front_light_mock = mock_ring_devices.get_device(765432) - front_light_mock.lights = "on" - - await hass.services.async_call("ring", "update", {}, blocking=True) - - await hass.async_block_till_done() - - state = hass.states.get("light.front_light") - assert state.state == "on" - - @pytest.mark.parametrize( ("exception_type", "reauth_expected"), [ diff --git a/tests/components/ring/test_switch.py b/tests/components/ring/test_switch.py index f7aa885342ad51..300bc1d7b3fd4b 100644 --- a/tests/components/ring/test_switch.py +++ b/tests/components/ring/test_switch.py @@ -4,11 +4,10 @@ import ring_doorbell from homeassistant.config_entries import SOURCE_REAUTH -from homeassistant.const import ATTR_ENTITY_ID, Platform +from homeassistant.const import Platform from homeassistant.core import HomeAssistant from homeassistant.exceptions import HomeAssistantError from homeassistant.helpers import entity_registry as er -from homeassistant.setup import async_setup_component from .common import setup_platform @@ -66,31 +65,6 @@ async def test_siren_can_be_turned_on(hass: HomeAssistant, mock_ring_client) -> assert state.state == "on" -async def test_updates_work( - hass: HomeAssistant, mock_ring_client, mock_ring_devices -) -> None: - """Tests the update service works correctly.""" - await setup_platform(hass, Platform.SWITCH) - state = hass.states.get("switch.front_siren") - assert state.state == "off" - - front_siren_mock = mock_ring_devices.get_device(765432) - front_siren_mock.siren = 20 - - await async_setup_component(hass, "homeassistant", {}) - await hass.services.async_call( - "homeassistant", - "update_entity", - {ATTR_ENTITY_ID: ["switch.front_siren"]}, - blocking=True, - ) - - await hass.async_block_till_done() - - state = hass.states.get("switch.front_siren") - assert state.state == "on" - - @pytest.mark.parametrize( ("exception_type", "reauth_expected"), [