Add food dispensed today and next feeding sensors to litterrobot (#152016)

Co-authored-by: Abílio Costa <abmantis@users.noreply.github.com>
This commit is contained in:
Nathan Spencer
2025-09-12 06:17:45 -04:00
committed by GitHub
parent 9f8f7d2fde
commit 5960179844
5 changed files with 57 additions and 0 deletions

View File

@@ -104,6 +104,7 @@ async def test_litter_robot_sensor(
assert sensor.attributes["state_class"] == SensorStateClass.TOTAL_INCREASING
@pytest.mark.freeze_time("2022-09-08 19:00:00+00:00")
async def test_feeder_robot_sensor(
hass: HomeAssistant, mock_account_with_feederrobot: MagicMock
) -> None:
@@ -117,6 +118,16 @@ async def test_feeder_robot_sensor(
assert sensor.state == "2022-09-08T18:00:00+00:00"
assert sensor.attributes["device_class"] == SensorDeviceClass.TIMESTAMP
sensor = hass.states.get("sensor.test_next_feeding")
assert sensor.state == "2022-09-09T12:30:00+00:00"
assert sensor.attributes["device_class"] == SensorDeviceClass.TIMESTAMP
sensor = hass.states.get("sensor.test_food_dispensed_today")
assert sensor.state == "0.375"
assert sensor.attributes["last_reset"] == "2022-09-08T00:00:00-07:00"
assert sensor.attributes["state_class"] == SensorStateClass.TOTAL
assert sensor.attributes["unit_of_measurement"] == "cups"
async def test_pet_weight_sensor(
hass: HomeAssistant, mock_account_with_pet: MagicMock