From 1c6a463f3ae1cde11a55bc1771439387c2ca03f0 Mon Sep 17 00:00:00 2001
From: moises <>
Date: Thu, 30 Aug 2018 18:30:52 +0000
Subject: [PATCH] 72_XiaomiDevice: resume zoned cleanup
git-svn-id: https://svn.fhem.de/fhem/trunk@17234 2b470e98-0d58-463d-a4d8-8e2adae1ed80
---
fhem/CHANGED | 1 +
fhem/FHEM/72_XiaomiDevice.pm | 25 ++++++++++++++++++-------
2 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/fhem/CHANGED b/fhem/CHANGED
index be017999f..61656f4d0 100644
--- a/fhem/CHANGED
+++ b/fhem/CHANGED
@@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it.
+ - feature: 72_XiaomiDevice: resume zoned cleanup
- feature: 51_MOBILEALERTS: Added MA10120PRO
- feature: 51_MOBILEALERTS: Added TFA30.3060.01.IT
- change: 89_FULLY: Set start URL and bug fixes
diff --git a/fhem/FHEM/72_XiaomiDevice.pm b/fhem/FHEM/72_XiaomiDevice.pm
index b0b70b8ed..b8747205e 100755
--- a/fhem/FHEM/72_XiaomiDevice.pm
+++ b/fhem/FHEM/72_XiaomiDevice.pm
@@ -579,9 +579,9 @@ sub XiaomiDevice_Set($$@) {
if(!defined($hash->{model}) || $hash->{model} ne "roborock.vacuum.c1") {
if(defined($hash->{helper}{zone_names})) {
- $list .= ' zone:'.$hash->{helper}{zone_names};
+ $list .= ' zone:'.$hash->{helper}{zone_names}.' resume:noArg';
} else {
- $list .= ' zone';
+ $list .= ' zone resume:noArg';
}
if(defined($hash->{helper}{point_names})) {
$list .= ' goto:'.$hash->{helper}{point_names};
@@ -767,6 +767,13 @@ sub XiaomiDevice_Set($$@) {
$zone = $hash->{helper}{zones}{$arg[0]} if(defined($hash->{helper}{zones}) && defined($hash->{helper}{zones}{$arg[0]}));
XiaomiDevice_WriteJSON($hash, '{"id":'.$packetid.',"method":"app_zoned_clean","params":['.$zone.']}' );
}
+ elsif ($cmd eq 'resume')
+ {
+ my $packetid = $hash->{helper}{packetid};
+ $hash->{helper}{packetid} = $packetid+1;
+ $hash->{helper}{packet}{$packetid} = "app_zoned_clean";
+ XiaomiDevice_WriteJSON($hash, '{"id":'.$packetid.',"method":"resume_zoned_clean","params":[""]}' );
+ }
elsif ($cmd eq 'goto')
{
$arg[0] = $hash->{helper}{points}{$arg[0]} if(defined($hash->{helper}{points}) && defined($hash->{helper}{points}{$arg[0]}));
@@ -1553,7 +1560,7 @@ sub XiaomiDevice_GetUpdate($)
if(defined($attr{$name}) && defined($attr{$name}{subType}) && $attr{$name}{subType} eq "VacuumCleaner")
{
my $currentstate = ReadingsVal($name,"state","-");
- if($currentstate eq "Cleaning" || $currentstate eq "Spot cleaning")
+ if($currentstate eq "Cleaning" || $currentstate eq "Spot cleaning" || $currentstate eq "Zoned Clean" || $currentstate eq "Goto")
{
$timerinterval = 90 if($timerinterval > 90);
}
@@ -2902,8 +2909,8 @@ sub XiaomiDevice_Attr($$$) {
return undef if(!defined($defs{$name}));
my $orig = $attrVal;
$attrVal = int($attrVal) if($attrName eq "intervalData" || $attrName eq "intervalSettings");
- $attrVal = 60 if($attrName eq "intervalData" && $attrVal < 60 );
- $attrVal = 300 if($attrName eq "intervalSettings" && $attrVal < 300 );
+ $attrVal = 10 if($attrName eq "intervalData" && $attrVal < 10 );
+ $attrVal = 60 if($attrName eq "intervalSettings" && $attrVal < 60 );
if( $attrName eq "disable" ) {
my $hash = $defs{$name};
@@ -3032,6 +3039,10 @@ sub XiaomiDevice_DbLog_splitFn($) {
Pause cleaning
+
resume
(VacuumCleaner)
+ stop
(VacuumCleaner)
intervalData
intervalSettings
preset
(AirPurifier)