Skip to content

Commit

Permalink
Add support for dreame trouver finder vacuum (#1514)
Browse files Browse the repository at this point in the history
* Add support for dreame trouver finder vacuum

* Fix black formatting

* Add Dreame Trouver Finder to supported devices
  • Loading branch information
Massl123 authored Aug 24, 2022
1 parent 13d6f4a commit ee94732
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ Supported devices
- Xiaomi Mijia STYJ02YM (Viomi)
- Xiaomi Mijia 1C STYTJ01ZHM (Dreame)
- Dreame F9, D9, Z10 Pro
- Dreame Trouver Finder
- Xiaomi Mi Home (Mijia) G1 Robot Vacuum Mop MJSTG1
- Xiaomi Roidmi Eve
- Xiaomi Mi Smart WiFi Socket
Expand Down
45 changes: 45 additions & 0 deletions miio/integrations/vacuum/dreame/dreamevacuum_miot.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
DREAME_MOP_2_PRO_PLUS = "dreame.vacuum.p2041o"
DREAME_MOP_2_ULTRA = "dreame.vacuum.p2150a"
DREAME_MOP_2 = "dreame.vacuum.p2150o"
DREAME_TROUVER_FINDER = "dreame.vacuum.p2036"

_DREAME_1C_MAPPING: MiotMapping = {
# https://home.miot-spec.com/spec/dreame.vacuum.mc1808
Expand Down Expand Up @@ -119,6 +120,48 @@
"play_sound": {"siid": 7, "aiid": 2},
}

_DREAME_TROUVER_FINDER_MAPPING: MiotMapping = {
# https://home.miot-spec.com/spec/dreame.vacuum.p2036
"battery_level": {"siid": 3, "piid": 1},
"charging_state": {"siid": 3, "piid": 2},
"device_fault": {"siid": 2, "piid": 2},
"device_status": {"siid": 2, "piid": 1},
"brush_left_time": {"siid": 9, "piid": 1},
"brush_life_level": {"siid": 9, "piid": 2},
"brush_left_time2": {"siid": 10, "piid": 1},
"brush_life_level2": {"siid": 10, "piid": 2},
"filter_life_level": {"siid": 11, "piid": 1},
"filter_left_time": {"siid": 11, "piid": 2},
"operating_mode": {"siid": 4, "piid": 1}, # work-mode
"cleaning_mode": {"siid": 4, "piid": 4},
"delete_timer": {"siid": 8, "aiid": 1},
"timer_enable": {"siid": 5, "piid": 1}, # do-not-disturb -> enable
"cleaning_time": {"siid": 4, "piid": 2},
"cleaning_area": {"siid": 4, "piid": 3},
"first_clean_time": {"siid": 12, "piid": 1},
"total_clean_time": {"siid": 12, "piid": 2},
"total_clean_times": {"siid": 12, "piid": 3},
"total_clean_area": {"siid": 12, "piid": 4},
"start_time": {"siid": 5, "piid": 2},
"stop_time": {"siid": 5, "piid": 3}, # end-time
"map_view": {"siid": 6, "piid": 1}, # map-data
"frame_info": {"siid": 6, "piid": 2},
"volume": {"siid": 7, "piid": 1},
"voice_package": {"siid": 7, "piid": 2}, # voice-packet-id
"water_flow": {"siid": 4, "piid": 5}, # mop-mode
"water_box_carriage_status": {"siid": 4, "piid": 6}, # waterbox-status
"timezone": {"siid": 8, "piid": 1}, # time-zone
"home": {"siid": 3, "aiid": 1}, # start-charge
"locate": {"siid": 7, "aiid": 1}, # audio -> position
"start_clean": {"siid": 4, "aiid": 1},
"stop_clean": {"siid": 4, "aiid": 2},
"reset_mainbrush_life": {"siid": 9, "aiid": 1},
"reset_filter_life": {"siid": 11, "aiid": 1},
"reset_sidebrush_life": {"siid": 10, "aiid": 1},
"move": {"siid": 21, "aiid": 1}, # not in documentation
"play_sound": {"siid": 7, "aiid": 2},
}

MIOT_MAPPING: Dict[str, MiotMapping] = {
DREAME_1C: _DREAME_1C_MAPPING,
DREAME_F9: _DREAME_F9_MAPPING,
Expand All @@ -127,6 +170,7 @@
DREAME_MOP_2_PRO_PLUS: _DREAME_F9_MAPPING,
DREAME_MOP_2_ULTRA: _DREAME_F9_MAPPING,
DREAME_MOP_2: _DREAME_F9_MAPPING,
DREAME_TROUVER_FINDER: _DREAME_TROUVER_FINDER_MAPPING,
}


Expand Down Expand Up @@ -203,6 +247,7 @@ def _get_cleaning_mode_enum_class(model):
DREAME_MOP_2_PRO_PLUS,
DREAME_MOP_2_ULTRA,
DREAME_MOP_2,
DREAME_TROUVER_FINDER,
):
return CleaningModeDreameF9
return None
Expand Down

0 comments on commit ee94732

Please sign in to comment.