* 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>
* 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>
* 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
* 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>
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>
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>
* 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
* 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