15 Commits

Author SHA1 Message Date
Luke Lashley
1cae866da9
Update Roborock Map on status change (#140873)
* update map on status change

* Update tests/components/roborock/test_image.py

Co-authored-by: Allen Porter <allen.porter@gmail.com>

* update code to handle state logic within async_update_data

* Update homeassistant/components/roborock/coordinator.py

Co-authored-by: Allen Porter <allen.porter@gmail.com>

* move previous_state and allow update on None

---------

Co-authored-by: Allen Porter <allen.porter@gmail.com>
2025-03-18 07:34:02 -07:00
Luke Lashley
0eac679a5a
Move MapData to Coordinator for Roborock (#140766)
* Move MapData to Coordinator

* seeing if mypy likes this

* delete dead code

* Some MR comments

* remove MapData and always update on startup if we don't have a stored map.

* don't do on demand updates

* remove unneeded logic and pull out map save

* Apply suggestions from code review

Co-authored-by: Allen Porter <allen.porter@gmail.com>

* see if mypy is happy

---------

Co-authored-by: Allen Porter <allen.porter@gmail.com>
2025-03-17 19:34:47 -07:00
Luke Lashley
a40bb2790e
Move Roborock map refresh to coordinator (#140758)
Move refresh coordinator to coordinator
2025-03-16 14:15:04 -07:00
Luke Lashley
b0db7b432e
Move Roborock MapParser to coordinator (#140750)
Move MapParser to coordinator
2025-03-16 12:55:00 -07:00
Luke Lashley
3c57b12cd1
Fix bug with all Roborock maps being set to the wrong map when empty (#138493)
* Fix bug with all maps being set to the same when empty

* fix parens

* fix other parens

* rework some of the logic

* few small updates

* Remove test that is no longer relevant

* remove updated time bump
2025-03-11 07:31:20 -07:00
Allen Porter
df59b1d4fa
Persist roborock maps to disk only on shutdown (#136889)
* Persist roborock maps to disk only on shutdown

* Rename on_unload to on_stop

* Spawn 1 executor thread and block writes to disk

* Update tests/components/roborock/test_image.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Use config entry setup instead of component setup

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2025-01-31 13:45:01 -05:00
Luke Lashley
4ce891512e
Add ability to cache Roborock maps instead of always reloading (#112047)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Allen Porter <allen.porter@gmail.com>
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
Co-authored-by: Allen Porter <allen@thebends.org>
Co-authored-by: Robert Resch <robert@resch.dev>
2025-01-29 18:16:28 +01:00
Allen Porter
a66cf62b09
Update roborock tests to only load the platform under test (#134694) 2025-01-07 14:08:12 +01:00
epenet
ac588ddc75
Use relative imports in tests [j-r] (#119282) 2024-06-10 13:32:31 +02:00
Luke Lashley
835ce919f4
Fix roborock image crashes (#116487) 2024-05-01 11:56:02 +02:00
Luke Lashley
968de08e4b
Bump python-roborock to 1.0.0 (#115324)
* refactor base code

* refactor tests code
2024-04-09 20:50:46 -04:00
Joost Lekkerkerker
6bb4e7d62c
Bump ruff to 0.3.4 (#112690)
Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-26 00:02:16 +01:00
Marc Mueller
32f3f46542
Add empty line after module docstring (2) [tests.components] (#112737) 2024-03-08 19:16:21 +01:00
J. Nick Koston
d5e1934942
Use an eager task in the update coordinator scheduled refresh (#111570)
* Use an eager task in the update coordinator scheduled refresh

We have a lot of places that will not suspend because the refresh function
decides it does not need to update. Currently these have to be scheduled
on the event loop even though they are a noop.

Since _handle_refresh_interval is subclassed in some integrations, I created
a dunder wrapper function to avoid integraions subclassing it

* fix time fires outside of patch
2024-02-26 23:31:08 -05:00
Luke Lashley
bee457ed6f
Add Image to Roborock to display maps (#102941)
* add image to roborock

* add vacuum position

* addressing MR comments

* remove room names as it isn't supported in base package

* 100% coverage

* remove unneeded map changes

* fix image logic

* optimize create_coordinator_maps

* only update time if map is valid

* Update test_image.py

* fix linting from merge conflict

* fix mypy complaints

* re-add vacuum to const

* fix hanging test

* Make map sleep a const

* adjust commenting to be less than 88 characters.

* bump map parser
2023-11-18 12:22:30 -08:00