Repository: home-assistant/core
Pull request #140873: Update Roborock Map on status change
Author: login: Lash-L
Labels: name: cla-signed
name: small-pr
description: PRs with less than 30 lines.
name: new-feature
name: has-tests
name: by-code-owner
name: Quality Scale: No score
name: integration: roborock
Created: 2025-03-18T13:14:32Z | Merged: 2025-03-18T14:34:06Z

<!--
  You are amazing! Thanks for contributing to our project!
  Please, DO NOT DELETE ANY TEXT from this template! (unless instructed).
-->
## Breaking change
<!--
  If your PR contains a breaking change for existing users, it is important
  to tell them what breaks, how to make it work again and why we did this.
  This piece of text is published with the release notes, so it helps if you
  write it towards our users, not us.
  Note: Remove this section if this PR is NOT a breaking change.
-->


## Proposed change
<!--
  Describe the big picture of your changes here to communicate to the
  maintainers why we should accept this pull request. If it fixes a bug
  or resolves a feature request, be sure to link to that issue in the
  additional information section.
-->
This makes it so that when the vacuums status changes, we will update the current map.

This means when it gets back to the dock, or has an error, etc. the map will update to give the user the latest information.

## Type of change
<!--
  What type of change does your PR introduce to Home Assistant?
  NOTE: Please, check only 1! box!
  If your PR requires multiple boxes to be checked, you'll most likely need to
  split it into multiple PRs. This makes things easier and faster to code review.
-->

- [ ] Dependency upgrade
- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New integration (thank you!)
- [x] New feature (which adds functionality to an existing integration)
- [ ] Deprecation (breaking change to happen in the future)
- [ ] Breaking change (fix/feature causing existing functionality to break)
- [ ] Code quality improvements to existing code or addition of tests

## Additional information
<!--
  Details are important, and help maintainers processing your PR.
  Please be sure to fill out additional details, if applicable.
-->

- This PR fixes or closes issue: fixes #110588
- This PR is related to issue: 
- Link to documentation pull request: 
- Link to developer documentation pull request: 
- Link to frontend pull request: 

## Checklist
<!--
  Put an `x` in the boxes that apply. You can also fill these out after
  creating the PR. If you're unsure about any of them, don't hesitate to ask.
  We're here to help! This is simply a reminder of what we are going to look
  for before merging your code.
-->

- [ ] The code change is tested and works locally.
- [ ] Local tests pass. **Your PR cannot be merged unless tests pass**
- [ ] There is no commented out code in this PR.
- [ ] I have followed the [development checklist][dev-checklist]
- [ ] I have followed the [perfect PR recommendations][perfect-pr]
- [ ] The code has been formatted using Ruff (`ruff format homeassistant tests`)
- [ ] Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

- [ ] Documentation added/updated for [www.home-assistant.io][docs-repository]

If the code communicates with devices, web services, or third-party tools:

- [ ] The [manifest file][manifest-docs] has all fields filled out correctly.  
      Updated and included derived files by running: `python3 -m script.hassfest`.
- [ ] New or updated dependencies have been added to `requirements_all.txt`.  
      Updated by running `python3 -m script.gen_requirements_all`.
- [ ] For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.

<!--
  This project is very active and we have a high turnover of pull requests.

  Unfortunately, the number of incoming pull requests is higher than what our
  reviewers can review and merge so there is a long backlog of pull requests
  waiting for review. You can help here!
  
  By reviewing another pull request, you will help raise the code quality of
  that pull request and the final review will be faster. This way the general
  pace of pull request reviews will go up and your wait time will go down.
  
  When picking a pull request to review, try to choose one that hasn't yet
  been reviewed.

  Thanks for helping out!
-->

To help with the load of incoming pull requests:

- [ ] I have reviewed two other [open pull requests][prs] in this repository.

[prs]: https://github.com/home-assistant/core/pulls?q=is%3Aopen+is%3Apr+-author%3A%40me+-draft%3Atrue+-label%3Awaiting-for-upstream+sort%3Acreated-desc+review%3Anone+-status%3Afailure

<!--
  Thank you for contributing <3

  Below, some useful links you could explore:
-->
[dev-checklist]: https://developers.home-assistant.io/docs/development_checklist/
[manifest-docs]: https://developers.home-assistant.io/docs/creating_integration_manifest/
[quality-scale]: https://developers.home-assistant.io/docs/integration_quality_scale_index/
[docs-repository]: https://github.com/home-assistant/home-assistant.io
[perfect-pr]: https://developers.home-assistant.io/docs/review-process/#creating-the-perfect-pr


Linked issue #110588: Roborock map not showing docked robot
### The problem

My robot has been docked for several hours now, but the map still shows the robot in the kitchen area (yellow/orange part on th eleft) while it is actually at the dock (on the right side of the central blue area). The Roborock app does show the correct map

Home Assistant map:
![image](https://github.com/home-assistant/core/assets/732514/9b5f7dd7-1db2-4d5a-a7cf-21cc4de383d0)

Roborock map:
![image](https://github.com/home-assistant/core/assets/732514/23a2b7b7-4035-42a2-aca4-323bdc8d024c)

Looking at the timestamps when the image and vacuum entity were last updated it looks like the map image was not updated after it docked. I assume that map updates are only done while it is cleaning, but maybe an additional last update could/should be done after it docked?

Image entity state according to entity state history:
![image](https://github.com/home-assistant/core/assets/732514/936d4299-131d-4a03-a166-5e37953e528b)

Vacuum entity state change to docked according to the entity state history
![image](https://github.com/home-assistant/core/assets/732514/d296f2d4-b165-4889-83fb-e5fa46204a5d)


### What version of Home Assistant Core has the issue?

core-2024.2.1

### What was the last working version of Home Assistant Core?

_No response_

### What type of installation are you running?

Home Assistant OS

### Integration causing the issue

Roborock

### Link to integration documentation on our website

https://www.home-assistant.io/integrations/roborock/

### Diagnostics information

[config_entry-roborock-47dd5a0c17ed868596ee8771370bbe3b.json](https://github.com/home-assistant/core/files/14285314/config_entry-roborock-47dd5a0c17ed868596ee8771370bbe3b.json)


### Example YAML snippet

_No response_

### Anything in the logs that might be useful for us?

_No response_

### Additional information

_No response_
Linked issue comments: user: login: home-assistant[bot]
created_at: 2024-02-14T19:50:14Z
body: 
Hey there @humbertogontijo, @lash-l, mind taking a look at this issue as it has been labeled with an integration (`roborock`) you are listed as a [code owner](https://github.com/home-assistant/core/blob/dev/CODEOWNERS#L1124) for? Thanks!

<details>
<summary>Code owner commands</summary>


Code owners of `roborock` can trigger bot actions by commenting:

- `@home-assistant close` Closes the issue.
- `@home-assistant rename Awesome new title` Renames the issue.
- `@home-assistant reopen` Reopen the issue.
- `@home-assistant unassign roborock` Removes the current integration label and assignees on the issue, add the integration domain after the command.
- `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
- `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

</details>


<sub><sup>(message by CodeOwnersMention)</sup></sub>

---

[roborock documentation](https://www.home-assistant.io/integrations/roborock)
[roborock source](https://github.com/home-assistant/core/tree/dev/homeassistant/components/roborock)
<sub><sup>(message by IssueLinks)</sup></sub>
author_association: CONTRIBUTOR
user: login: Lash-L
created_at: 2024-03-04T13:57:36Z
body: You are correct - map updates are only done while they are cleaning.   It probably would be sane if it updated one more time. I'll think about this problem a bit more.
author_association: CONTRIBUTOR
user: login: nicoodeimos
created_at: 2024-05-06T08:04:16Z
body: I can confirm I have the same issue with Roborock s7 maxV.
author_association: NONE
user: login: jc4thirty
created_at: 2024-05-08T20:22:21Z
body: Confirming the same issue with both s4 and s4 Max here.
author_association: NONE
user: login: issue-triage-workflows[bot]
created_at: 2024-08-06T21:07:37Z
body: There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
author_association: NONE
user: login: Lash-L
created_at: 2024-08-07T12:30:19Z
body: Not stale
author_association: CONTRIBUTOR
user: login: Oleg-Sob
created_at: 2024-10-22T11:41:26Z
body: The problem remains.
author_association: NONE
user: login: issue-triage-workflows[bot]
created_at: 2025-01-20T12:10:25Z
body: There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
author_association: NONE

Diff:
diff --git a/homeassistant/components/roborock/coordinator.py b/homeassistant/components/roborock/coordinator.py
index e430e2f630198d..c333b143b10438 100644
--- a/homeassistant/components/roborock/coordinator.py
+++ b/homeassistant/components/roborock/coordinator.py
@@ -279,6 +279,7 @@ async def _update_device_prop(self) -> None:
 
     async def _async_update_data(self) -> DeviceProp:
         """Update data via library."""
+        previous_state = self.roborock_device_info.props.status.state_name
         try:
             # Update device props and standard api information
             await self._update_device_prop()
@@ -288,11 +289,14 @@ async def _async_update_data(self) -> DeviceProp:
 
             # If the vacuum is currently cleaning and it has been IMAGE_CACHE_INTERVAL
             # since the last map update, you can update the map.
-            if (
-                self.current_map is not None
-                and self.roborock_device_info.props.status.in_cleaning
-                and (dt_util.utcnow() - self.maps[self.current_map].last_updated)
-                > IMAGE_CACHE_INTERVAL
+            new_status = self.roborock_device_info.props.status
+            if self.current_map is not None and (
+                (
+                    new_status.in_cleaning
+                    and (dt_util.utcnow() - self.maps[self.current_map].last_updated)
+                    > IMAGE_CACHE_INTERVAL
+                )
+                or previous_state != new_status.state_name
             ):
                 try:
                     await self.update_map()
diff --git a/tests/components/roborock/test_image.py b/tests/components/roborock/test_image.py
index 0cd9d625920d48..b7c811e0ce2f01 100644
--- a/tests/components/roborock/test_image.py
+++ b/tests/components/roborock/test_image.py
@@ -11,6 +11,7 @@
 from vacuum_map_parser_base.map_data import ImageConfig, ImageData
 
 from homeassistant.components.roborock import DOMAIN
+from homeassistant.components.roborock.const import V1_LOCAL_NOT_CLEANING_INTERVAL
 from homeassistant.config_entries import ConfigEntryState
 from homeassistant.const import Platform
 from homeassistant.core import HomeAssistant
@@ -158,9 +159,6 @@ async def test_fail_to_load_image(
 ) -> None:
     """Test that we gracefully handle failing to load an image."""
     with (
-        patch(
-            "homeassistant.components.roborock.coordinator.RoborockMapDataParser.parse",
-        ) as parse_map,
         patch(
             "homeassistant.components.roborock.roborock_storage.Path.exists",
             return_value=True,
@@ -177,8 +175,6 @@ async def test_fail_to_load_image(
         await hass.config_entries.async_reload(setup_entry.entry_id)
         await hass.async_block_till_done()
         assert read_bytes.call_count == 4
-        # Ensure that we never updated the map manually since we couldn't load it.
-        assert parse_map.call_count == 0
     assert "Unable to read map file" in caplog.text
 
 
@@ -298,3 +294,52 @@ async def test_index_error_map(
     # last_updated timestamp.
     assert resp.ok
     assert previous_state == hass.states.get("image.roborock_s7_maxv_upstairs").state
+
+
+async def test_map_status_change(
+    hass: HomeAssistant,
+    setup_entry: MockConfigEntry,
+    hass_client: ClientSessionGenerator,
+) -> None:
+    """Test floor plan map image is correctly updated on status change."""
+    assert len(hass.states.async_all("image")) == 4
+
+    assert hass.states.get("image.roborock_s7_maxv_upstairs") is not None
+    client = await hass_client()
+    resp = await client.get("/api/image_proxy/image.roborock_s7_maxv_upstairs")
+    assert resp.status == HTTPStatus.OK
+    old_body = await resp.read()
+    assert old_body[0:4] == b"\x89PNG"
+
+    # Call a second time. This interval does not directly trigger a map update, but does
+    # trigger a status update which detects the state has changed and uddates the map
+    now = dt_util.utcnow() + V1_LOCAL_NOT_CLEANING_INTERVAL
+
+    # Copy the device prop so we don't override it
+    prop = copy.deepcopy(PROP)
+    prop.status.state_name = "testing"
+    new_map_data = copy.deepcopy(MAP_DATA)
+    new_map_data.image = ImageData(
+        100, 10, 10, 10, 10, ImageConfig(), Image.new("RGB", (2, 2)), lambda p: p
+    )
+    with (
+        patch(
+            "homeassistant.components.roborock.coordinator.RoborockLocalClientV1.get_prop",
+            return_value=prop,
+        ),
+        patch(
+            "homeassistant.components.roborock.coordinator.dt_util.utcnow",
+            return_value=now,
+        ),
+        patch(
+            "homeassistant.components.roborock.coordinator.RoborockMapDataParser.parse",
+            return_value=new_map_data,
+        ),
+    ):
+        async_fire_time_changed(hass, now)
+        resp = await client.get("/api/image_proxy/image.roborock_s7_maxv_upstairs")
+        assert resp.status == HTTPStatus.OK
+    assert resp.status == HTTPStatus.OK
+    body = await resp.read()
+    assert body is not None
+    assert body != old_body


Reviews:
user: login: allenporter
state: CHANGES_REQUESTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-18T13:20:46Z
user: login: allenporter
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-18T13:24:59Z
user: login: Lash-L
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-18T13:25:09Z
user: login: Lash-L
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-18T13:26:07Z
user: login: allenporter
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-18T13:36:44Z
user: login: Lash-L
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-18T13:41:23Z
user: login: Lash-L
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-18T13:53:49Z
user: login: allenporter
state: CHANGES_REQUESTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-18T14:04:14Z
user: login: allenporter
body: I realize my suggestion now leaves the variables with inconsistent names ("state" vs "status") so maybe that was the wrong naming.
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-18T14:11:55Z
user: login: Lash-L
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-18T14:13:01Z
user: login: allenporter
body: So the test change is we fail to load it from disk, but we still fetch it from the server so it gets loaded?
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-03-18T14:15:19Z

Review comments:
diff_hunk: @@ -206,6 +206,7 @@ async def _async_setup(self) -> None:
                 rooms={},
                 image=image,
                 last_updated=dt_util.utcnow() - IMAGE_CACHE_INTERVAL,
+                last_status=None,
path: homeassistant/components/roborock/coordinator.py
user: login: allenporter
body: The last status is a coordinator level attribute, not specific to each map. Would should want to reduce the scope of the variable to be as small as possible.

What I would expect is to assign a local variable in `_async_update_data` with `roborock_device_info.props.status.state_name` before `_update_device_prop` then check it after, so its all in a single place.
created_at: 2025-03-18T13:20:41Z
author_association: CONTRIBUTOR
diff_hunk: @@ -298,3 +299,51 @@ async def test_index_error_map(
     # last_updated timestamp.
     assert resp.ok
     assert previous_state == hass.states.get("image.roborock_s7_maxv_upstairs").state
+
+
+async def test_map_status_change(
+    hass: HomeAssistant,
+    setup_entry: MockConfigEntry,
+    hass_client: ClientSessionGenerator,
+) -> None:
+    """Test floor plan map image is correctly updated on status change."""
+    assert len(hass.states.async_all("image")) == 4
+
+    assert hass.states.get("image.roborock_s7_maxv_upstairs") is not None
+    client = await hass_client()
+    resp = await client.get("/api/image_proxy/image.roborock_s7_maxv_upstairs")
+    assert resp.status == HTTPStatus.OK
+    old_body = await resp.read()
+    assert old_body[0:4] == b"\x89PNG"
+
+    # Call a second time - this time forcing it to update - and save new image
path: tests/components/roborock/test_image.py
user: login: allenporter
body: I think its something like this happening:
```suggestion
    # Call a second time. This interval does not directly trigger a map update, but does
    # trigger a status update which detects the state has changed and uddates the map
```
created_at: 2025-03-18T13:24:59Z
author_association: CONTRIBUTOR
diff_hunk: @@ -206,6 +206,7 @@ async def _async_setup(self) -> None:
                 rooms={},
                 image=image,
                 last_updated=dt_util.utcnow() - IMAGE_CACHE_INTERVAL,
+                last_status=None,
path: homeassistant/components/roborock/coordinator.py
user: login: Lash-L
body: It is a coordinator level attribute, but it is updated for the specific map flag.

i.e. whenever we are checking it, it is being checked when that specific map is selected.

I can change it how you described it, but I think I just need you to explain a bit more the benefit of doing it the other way

created_at: 2025-03-18T13:25:08Z
author_association: CONTRIBUTOR
diff_hunk: @@ -298,3 +299,51 @@ async def test_index_error_map(
     # last_updated timestamp.
     assert resp.ok
     assert previous_state == hass.states.get("image.roborock_s7_maxv_upstairs").state
+
+
+async def test_map_status_change(
+    hass: HomeAssistant,
+    setup_entry: MockConfigEntry,
+    hass_client: ClientSessionGenerator,
+) -> None:
+    """Test floor plan map image is correctly updated on status change."""
+    assert len(hass.states.async_all("image")) == 4
+
+    assert hass.states.get("image.roborock_s7_maxv_upstairs") is not None
+    client = await hass_client()
+    resp = await client.get("/api/image_proxy/image.roborock_s7_maxv_upstairs")
+    assert resp.status == HTTPStatus.OK
+    old_body = await resp.read()
+    assert old_body[0:4] == b"\x89PNG"
+
+    # Call a second time - this time forcing it to update - and save new image
path: tests/components/roborock/test_image.py
user: login: Lash-L
body: Yep - thanks, that was a copied over comment that was stale.
created_at: 2025-03-18T13:26:07Z
author_association: CONTRIBUTOR
diff_hunk: @@ -206,6 +206,7 @@ async def _async_setup(self) -> None:
                 rooms={},
                 image=image,
                 last_updated=dt_util.utcnow() - IMAGE_CACHE_INTERVAL,
+                last_status=None,
path: homeassistant/components/roborock/coordinator.py
user: login: allenporter
body: My thinking is the state of the device does not depend on the map flag.

My mental model for this is that this is the common case of the setup scenario:
- robot is "cleaning" at t1 
- the map is refreshed also at at t1
- robot finishes cleaning at t1 + 14 seconds, now internal status is "docked"
- a refresh happens at t1 + 15 seconds updating the coordinator state to "docked" ....
My impression is that once that happens we want to trigger a refresh here so we notice the state changed from "cleaning" to "docked".  OK.
- ... so then the map is refreshed at t1 + 15 during that update.

We don't need to store any other state at a map level, given we're just looking for the device state transition.

If you want to handle a case where the map is changing, that can also be a reason to trigger new map bytes. 

It can all be done within a single function so thats fewer lines of code/logic spread across, no extra state/side effects to worry about, you can read all the logic on one screen, etc.
created_at: 2025-03-18T13:36:42Z
author_association: CONTRIBUTOR
diff_hunk: @@ -206,6 +206,7 @@ async def _async_setup(self) -> None:
                 rooms={},
                 image=image,
                 last_updated=dt_util.utcnow() - IMAGE_CACHE_INTERVAL,
+                last_status=None,
path: homeassistant/components/roborock/coordinator.py
user: login: Lash-L
body: That all makes sense to me -  thank you for the explanation! I think I just needed help wrapping my head around the reasoning. Will commit a update
created_at: 2025-03-18T13:41:23Z
author_association: CONTRIBUTOR
diff_hunk: @@ -206,6 +206,7 @@ async def _async_setup(self) -> None:
                 rooms={},
                 image=image,
                 last_updated=dt_util.utcnow() - IMAGE_CACHE_INTERVAL,
+                last_status=None,
path: homeassistant/components/roborock/coordinator.py
user: login: Lash-L
body: Updated - Definitely is better, thank you for taking the time to walk me through it!
created_at: 2025-03-18T13:53:48Z
author_association: CONTRIBUTOR
diff_hunk: @@ -280,6 +280,7 @@ async def _update_device_prop(self) -> None:
     async def _async_update_data(self) -> DeviceProp:
         """Update data via library."""
         try:
+            previous_state = self.roborock_device_info.props.status.state_name
path: homeassistant/components/roborock/coordinator.py
user: login: allenporter
body: This can be outside the scope of the `try`. Always best to reduce the scope in the try block as much as possible to focus only on what can actually throw.
created_at: 2025-03-18T13:58:32Z
author_association: CONTRIBUTOR
diff_hunk: @@ -288,11 +289,16 @@ async def _async_update_data(self) -> DeviceProp:
 
             # If the vacuum is currently cleaning and it has been IMAGE_CACHE_INTERVAL
             # since the last map update, you can update the map.
-            if (
-                self.current_map is not None
-                and self.roborock_device_info.props.status.in_cleaning
-                and (dt_util.utcnow() - self.maps[self.current_map].last_updated)
-                > IMAGE_CACHE_INTERVAL
+            if self.current_map is not None and (
+                (
+                    self.roborock_device_info.props.status.in_cleaning
+                    and (dt_util.utcnow() - self.maps[self.current_map].last_updated)
+                    > IMAGE_CACHE_INTERVAL
+                )
+                or (
+                    previous_state != self.roborock_device_info.props.status.state_name
+                    and previous_state is not None
+                )
path: homeassistant/components/roborock/coordinator.py
user: login: allenporter
body: Can `previous_state is not None` be omitted? That seems to indicate it would be the first refresh, which seems fine to do a map update. Also extracting a local status variable can help avoid some wrapping that might benefit readability:

```suggestion
            new_state = self.roborock_device_info.props.status
            if self.current_map is not None and (
                (
                    new_state.in_cleaning
                    and (dt_util.utcnow() - self.maps[self.current_map].last_updated)
                    > IMAGE_CACHE_INTERVAL
                )
                or previous_state != new_state.state_name
```
created_at: 2025-03-18T14:04:10Z
author_association: CONTRIBUTOR
diff_hunk: @@ -288,11 +289,16 @@ async def _async_update_data(self) -> DeviceProp:
 
             # If the vacuum is currently cleaning and it has been IMAGE_CACHE_INTERVAL
             # since the last map update, you can update the map.
-            if (
-                self.current_map is not None
-                and self.roborock_device_info.props.status.in_cleaning
-                and (dt_util.utcnow() - self.maps[self.current_map].last_updated)
-                > IMAGE_CACHE_INTERVAL
+            if self.current_map is not None and (
+                (
+                    self.roborock_device_info.props.status.in_cleaning
+                    and (dt_util.utcnow() - self.maps[self.current_map].last_updated)
+                    > IMAGE_CACHE_INTERVAL
+                )
+                or (
+                    previous_state != self.roborock_device_info.props.status.state_name
+                    and previous_state is not None
+                )
path: homeassistant/components/roborock/coordinator.py
user: login: Lash-L
body: This does make a small change to a test - but i think it's fine as it is a logical improvement.
created_at: 2025-03-18T14:13:01Z
author_association: CONTRIBUTOR

PR comments:
user: login: home-assistant[bot]
created_at: 2025-03-18T13:14:40Z
body: 
Hey there @allenporter, mind taking a look at this pull request as it has been labeled with an integration (`roborock`) you are listed as a [code owner](https://github.com/home-assistant/core/blob/dev/CODEOWNERS#L1284) for? Thanks!

<details>
<summary>Code owner commands</summary>


Code owners of `roborock` can trigger bot actions by commenting:

- `@home-assistant close` Closes the pull request.
- `@home-assistant rename Awesome new title` Renames the pull request.
- `@home-assistant reopen` Reopen the pull request.
- `@home-assistant unassign roborock` Removes the current integration label and assignees on the pull request, add the integration domain after the command.
- `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the pull request.
- `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.

</details>


author_association: CONTRIBUTOR
user: login: home-assistant[bot]
created_at: 2025-03-18T13:20:49Z
body: <!-- ReviewDrafterComment -->
Please take a look at the requested changes, and use the **Ready for review** button when you are done, thanks :+1:

[_Learn more about our pull request process._](https://developers.home-assistant.io/docs/review-process#prs-are-being-drafted-when-changes-are-needed)

author_association: CONTRIBUTOR
user: login: Lash-L
created_at: 2025-03-18T14:13:20Z
body: > I realize my suggestion now leaves the variables with inconsistent names ("state" vs "status") so maybe that was the wrong naming.

i've made a change to the name 
author_association: CONTRIBUTOR
user: login: Lash-L
created_at: 2025-03-18T14:16:21Z
body: > So the test change is we fail to load it from disk, but we still fetch it from the server so it gets loaded?

Yes previously - we would fail to have an image at all.

Now we fail to load from the disk, but we still load manually.
author_association: CONTRIBUTOR
user: login: allenporter
created_at: 2025-03-18T14:33:58Z
body: Marking as fixing #110588
author_association: CONTRIBUTOR