[miio] Add Roborock S7/S7MaxV mop mode (#16608)

* [miio] Add Roborock S7/S7MaxV mop mode
Signed-off-by: Ruediger Sopp <ruediger.sopp@gmail.com>
This commit is contained in:
Rüdiger Sopp 2024-04-05 21:10:32 +02:00 committed by GitHub
parent 2e4886aeaa
commit 23502fcb9b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 34 additions and 0 deletions

View File

@ -248,6 +248,7 @@ Additionally depending on the capabilities of your robot vacuum other channels m
| Switch | status#water_box_status | Water Box Status |
| Switch | status#lock_status | Lock Status |
| Number | status#water_box_mode | Water Box Mode |
| Number | status#mop_mode | Mop Mode |
| Switch | status#water_box_carriage_status | Water Box Carriage Status |
| Switch | status#mop_forbidden_enable | Mop Forbidden |
| Switch | status#is_locating | Robot is locating |

View File

@ -642,6 +642,7 @@ Additionally depending on the capabilities of your robot vacuum other channels m
| Switch | status#water_box_status | Water Box Status |
| Switch | status#lock_status | Lock Status |
| Number | status#water_box_mode | Water Box Mode |
| Number | status#mop_mode | Mop Mode |
| Switch | status#water_box_carriage_status | Water Box Carriage Status |
| Switch | status#mop_forbidden_enable | Mop Forbidden |
| Switch | status#is_locating | Robot is locating |

View File

@ -79,6 +79,7 @@ public enum MiIoCommand {
SET_MODE("set_custom_mode"),
GET_MODE("get_custom_mode"),
SET_WATERBOX_MODE("set_water_box_custom_mode"),
SET_MOP_MODE("set_mop_mode"),
TIMERZONE_SET("set_timezone"),
TIMERZONE_GET("get_timezone"),

View File

@ -250,6 +250,11 @@ public class MiIoVacuumHandler extends MiIoAbstractHandler {
forceStatusUpdate();
return;
}
if (channelUID.getId().equals(RobotCababilities.MOP_MODE.getChannel())) {
sendCommand(MiIoCommand.SET_MOP_MODE, "[" + command.toString() + "]");
forceStatusUpdate();
return;
}
if (channelUID.getId().equals(RobotCababilities.SEGMENT_CLEAN.getChannel()) && !command.toString().isEmpty()
&& !command.toString().contentEquals("-")) {
sendCommand(MiIoCommand.START_SEGMENT, "[" + command.toString() + "]");
@ -383,6 +388,9 @@ public class MiIoVacuumHandler extends MiIoAbstractHandler {
if (deviceCapabilities.containsKey(RobotCababilities.WATERBOX_MODE)) {
safeUpdateState(RobotCababilities.WATERBOX_MODE.getChannel(), statusInfo.getWaterBoxMode());
}
if (deviceCapabilities.containsKey(RobotCababilities.MOP_MODE)) {
safeUpdateState(RobotCababilities.MOP_MODE.getChannel(), statusInfo.getMopMode());
}
if (deviceCapabilities.containsKey(RobotCababilities.WATERBOX_STATUS)) {
safeUpdateState(RobotCababilities.WATERBOX_STATUS.getChannel(), statusInfo.getWaterBoxStatus());
}

View File

@ -26,6 +26,7 @@ public enum RobotCababilities {
WATERBOX_STATUS("water_box_status", "status#water_box_status", "miio:water_box_status", ""),
LOCKSTATUS("lock_status", "status#lock_status", "miio:lock_status", ""),
WATERBOX_MODE("water_box_mode", "status#water_box_mode", "miio:water_box_mode", ""),
MOP_MODE("mop_mode", "status#mop_mode", "miio:mop_mode", ""),
WATERBOX_CARRIAGE("water_box_carriage_status", "status#water_box_carriage_status", "miio:water_box_carriage_status",
""),
MOP_FORBIDDEN("mop_forbidden_enable", "status#mop_forbidden_enable", "miio:mop_forbidden_enable", ""),

View File

@ -79,6 +79,9 @@ public class StatusDTO {
@SerializedName("water_box_mode")
@Expose
private Integer waterBoxMode;
@SerializedName("mop_mode")
@Expose
private Integer mopMode;
@SerializedName("water_box_carriage_status")
@Expose
private Integer waterBoxCarriageStatus;
@ -171,6 +174,10 @@ public class StatusDTO {
return waterBoxMode;
}
public final Integer getMopMode() {
return mopMode;
}
public final Integer getWaterBoxCarriageStatus() {
return waterBoxCarriageStatus;
}

View File

@ -179,6 +179,10 @@ channel-type.miio.total_clean_time.label = Total Cleaning Time
channel-type.miio.vacuum.label = Vacuum On/Off
channel-type.miio.water_box_carriage_status.label = Water Box Carriage State
channel-type.miio.water_box_mode.label = Water Box Mode
channel-type.miio.mop_mode.label = Mop Mode
channel-type.miio.mop_mode.state.option.300 = Standard
channel-type.miio.mop_mode.state.option.301 = Deep
channel-type.miio.mop_mode.state.option.303 = Deep+
channel-type.miio.water_box_status.label = Water Box State
# thing status descriptions

View File

@ -190,6 +190,17 @@
<label>Water Box Mode</label>
<state min="200" max="204" step="1" pattern="%.0f%%" readOnly="false"/>
</channel-type>
<channel-type id="mop_mode">
<item-type>Number</item-type>
<label>Water Box Mode</label>
<state min="300" max="303" step="1" pattern="%.0f%%" readOnly="false">
<options>
<option value="300">Standard</option>
<option value="301">Deep</option>
<option value="303">Deep+</option>
</options>
</state>
</channel-type>
<channel-type id="water_box_status">
<item-type>Switch</item-type>
<label>Water Box State</label>