mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[miio] Add Roborock S7/S7MaxV mop mode (#16608)
* [miio] Add Roborock S7/S7MaxV mop mode Signed-off-by: Ruediger Sopp <ruediger.sopp@gmail.com> Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
This commit is contained in:
parent
84d7b478fd
commit
94bcec917e
@ -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 |
|
||||
|
@ -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 |
|
||||
|
@ -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"),
|
||||
|
@ -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());
|
||||
}
|
||||
|
@ -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", ""),
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user