v6: Multiple Roborock devices swap attributes
Describe the bug I have 2 Roborock vacuums added to Home Assistant (with the dev integration running against this library from source). They occasionally swap sensor values between vacuums.
Version information (please complete the following information):
- OS: Linux
- python-miio: Current HEAD
For example, I see the following HA logs:
2024-03-19 11:05:10.279 INFO (Recorder) [homeassistant.components.sensor.recorder] Detected new cycle for sensor.lift_total_clean_count, value dropped from 1017.0 to 150.0, triggered by state with last_updated set to 2024-03-19T15:00:18.958009+00:00
2024-03-19 11:05:10.279 INFO (Recorder) [homeassistant.components.sensor.recorder] Detected new cycle for sensor.lift_total_dust_collection_count, value dropped from 1278.0 to 160.0, triggered by state with last_updated set to 2024-03-19T15:00:18.958043+00:00
Looking further in the logs, in one place, I see 2 copies of 2024-03-19 11:16:19.142 INFO (MainThread) [custom_components.xiaomi.coordinator] Got new state for <RoborockVacuum: ...>: for my 2 vacuums (with different IP addresses), with identical ConsumableStatus and CleaningSummary entries, but different CleaningDetails and VacuumStatus entries. In most places, all of those entries are (correctly) different for the 2 vacuums.
The HA history graph for the same entity in the 2 vacuums looks like this; you can see the values swap.
I'm seeing similar confusion in the map list; my vacuums have one and three maps, but it looks like the Current Map dropdown in HA shows the same set of maps for both vacuums (sometimes one, sometimes three)