Skip to content

Commit

Permalink
[miio] add channel for is_locating (openhab#10036)
Browse files Browse the repository at this point in the history
close: openhab#10033

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
  • Loading branch information
marcelrv authored Feb 3, 2021
1 parent 6c582d1 commit 3850570
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bundles/org.openhab.binding.miio/README.base.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ Number statusFanPow "Fan Power [%1.0f%%]" <signal> (gVacStat) {channel="mi
Number statusClean "In Cleaning Status [%1.0f]" <switch> (gVacStat) {channel="miio:vacuum:034F0E45:status#in_cleaning" }
Switch statusDND "DND Activated" (gVacStat) {channel="miio:vacuum:034F0E45:status#dnd_enabled" }
Number statusStatus "Status [%1.0f]" <status> (gVacStat) {channel="miio:vacuum:034F0E45:status#state"}
Switch isLocating "Locating" (gVacStat) {channel="miio:vacuum:034F0E45:status#is_locating" }
Number consumableMain "Main Brush [%1.0f]" (gVacCons) {channel="miio:vacuum:034F0E45:consumables#main_brush_time"}
Number consumableSide "Side Brush [%1.0f]" (gVacCons) {channel="miio:vacuum:034F0E45:consumables#side_brush_time"}
Expand Down Expand Up @@ -254,6 +255,7 @@ Additionally depending on the capabilities of your robot vacuum other channels m
| Number | status#water_box_mode | Water Box 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 |
| Number | actions#segment | Room Clean (enter room #) |


Expand Down
2 changes: 2 additions & 0 deletions bundles/org.openhab.binding.miio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4437,6 +4437,7 @@ Number statusFanPow "Fan Power [%1.0f%%]" <signal> (gVacStat) {channel="mi
Number statusClean "In Cleaning Status [%1.0f]" <switch> (gVacStat) {channel="miio:vacuum:034F0E45:status#in_cleaning" }
Switch statusDND "DND Activated" (gVacStat) {channel="miio:vacuum:034F0E45:status#dnd_enabled" }
Number statusStatus "Status [%1.0f]" <status> (gVacStat) {channel="miio:vacuum:034F0E45:status#state"}
Switch isLocating "Locating" (gVacStat) {channel="miio:vacuum:034F0E45:status#is_locating" }

Number consumableMain "Main Brush [%1.0f]" (gVacCons) {channel="miio:vacuum:034F0E45:consumables#main_brush_time"}
Number consumableSide "Side Brush [%1.0f]" (gVacCons) {channel="miio:vacuum:034F0E45:consumables#side_brush_time"}
Expand Down Expand Up @@ -4473,6 +4474,7 @@ Additionally depending on the capabilities of your robot vacuum other channels m
| Number | status#water_box_mode | Water Box 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 |
| Number | actions#segment | Room Clean (enter room #) |


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,9 @@ private boolean updateVacuumStatus(JsonObject statusData) {
if (deviceCapabilities.containsKey(RobotCababilities.MOP_FORBIDDEN)) {
safeUpdateState(RobotCababilities.MOP_FORBIDDEN.getChannel(), statusInfo.getMopForbiddenEnable());
}
if (deviceCapabilities.containsKey(RobotCababilities.LOCATING)) {
safeUpdateState(RobotCababilities.LOCATING.getChannel(), statusInfo.getIsLocating());
}
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public enum RobotCababilities {
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"),
LOCATING("is_locating", "status#is_locating", "miio:is_locating"),
SEGMENT_CLEAN("", "actions#segment", "miio:segment");

private final String statusFieldName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,11 @@
<label>Mop Forbidden</label>
<state readOnly="true"/>
</channel-type>
<channel-type id="is_locating">
<item-type>Switch</item-type>
<label>Robot Locating</label>
<state readOnly="true"/>
</channel-type>

<!-- Consumables channels -->
<channel-type id="main_brush_percent">
Expand Down

0 comments on commit 3850570

Please sign in to comment.