From 683c6b17bee84f487f56dc7e3bdc773a3413fa3d Mon Sep 17 00:00:00 2001 From: Nathan Spencer Date: Tue, 30 Sep 2025 09:47:27 -0600 Subject: [PATCH] Add release url to Litter-Robot 4 update entity (#152504) --- homeassistant/components/litterrobot/update.py | 2 ++ tests/components/litterrobot/test_update.py | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/homeassistant/components/litterrobot/update.py b/homeassistant/components/litterrobot/update.py index 4d9dfe5074d..8f3a176175b 100644 --- a/homeassistant/components/litterrobot/update.py +++ b/homeassistant/components/litterrobot/update.py @@ -26,6 +26,7 @@ FIRMWARE_UPDATE_ENTITY = UpdateEntityDescription( key="firmware", device_class=UpdateDeviceClass.FIRMWARE, ) +RELEASE_URL = "https://www.litter-robot.com/releases.html" async def async_setup_entry( @@ -48,6 +49,7 @@ async def async_setup_entry( class RobotUpdateEntity(LitterRobotEntity[LitterRobot4], UpdateEntity): """A class that describes robot update entities.""" + _attr_release_url = RELEASE_URL _attr_supported_features = ( UpdateEntityFeature.INSTALL | UpdateEntityFeature.PROGRESS ) diff --git a/tests/components/litterrobot/test_update.py b/tests/components/litterrobot/test_update.py index b1b092e1f02..f7d7492dec8 100644 --- a/tests/components/litterrobot/test_update.py +++ b/tests/components/litterrobot/test_update.py @@ -5,9 +5,11 @@ from unittest.mock import AsyncMock, MagicMock from pylitterbot import LitterRobot4 import pytest +from homeassistant.components.litterrobot.update import RELEASE_URL from homeassistant.components.update import ( ATTR_INSTALLED_VERSION, ATTR_LATEST_VERSION, + ATTR_RELEASE_URL, DOMAIN as PLATFORM_DOMAIN, SERVICE_INSTALL, UpdateDeviceClass, @@ -47,6 +49,7 @@ async def test_robot_with_no_update( assert state.attributes[ATTR_DEVICE_CLASS] == UpdateDeviceClass.FIRMWARE assert state.attributes[ATTR_INSTALLED_VERSION] == OLD_FIRMWARE assert state.attributes[ATTR_LATEST_VERSION] == OLD_FIRMWARE + assert state.attributes[ATTR_RELEASE_URL] == RELEASE_URL assert await hass.config_entries.async_unload(entry.entry_id) await hass.async_block_till_done() @@ -68,6 +71,7 @@ async def test_robot_with_update( assert state.attributes[ATTR_DEVICE_CLASS] == UpdateDeviceClass.FIRMWARE assert state.attributes[ATTR_INSTALLED_VERSION] == OLD_FIRMWARE assert state.attributes[ATTR_LATEST_VERSION] == NEW_FIRMWARE + assert state.attributes[ATTR_RELEASE_URL] == RELEASE_URL robot.update_firmware = AsyncMock(return_value=False) @@ -106,6 +110,7 @@ async def test_robot_with_update_already_in_progress( assert state.attributes[ATTR_DEVICE_CLASS] == UpdateDeviceClass.FIRMWARE assert state.attributes[ATTR_INSTALLED_VERSION] == OLD_FIRMWARE assert state.attributes[ATTR_LATEST_VERSION] is None + assert state.attributes[ATTR_RELEASE_URL] == RELEASE_URL assert await hass.config_entries.async_unload(entry.entry_id) await hass.async_block_till_done()