2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-09 14:47:00 +00:00

72_XiaomiDevice: vacuum events

git-svn-id: https://svn.fhem.de/fhem/trunk@17236 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
moises 2018-08-30 20:15:10 +00:00
parent e7eda90b79
commit a96b30a4a1
2 changed files with 10 additions and 2 deletions

View File

@ -1,6 +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: 72_XiaomiDevice: vacuum events, 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

View File

@ -1582,7 +1582,7 @@ sub XiaomiDevice_GetUpdate($)
if( defined($attr{$name}) && defined($attr{$name}{subType}) && $attr{$name}{subType} eq "VacuumCleaner")
{
$hash->{helper}{packet}{$packetid} = "get_status";
XiaomiDevice_WriteJSON($hash, '{"id":'.$packetid.',"method":"get_status","params":[""]}' );
XiaomiDevice_WriteJSON($hash, '{"id":'.$packetid.',"method":"get_prop","params":["get_status"]}' );
}
elsif( defined($attr{$name}) && defined($attr{$name}{subType}) && $attr{$name}{subType} eq "AirPurifier")
{
@ -2247,6 +2247,10 @@ sub XiaomiDevice_ParseJSON($$)
return undef if(ref($json->{result}) ne "ARRAY");
return undef if(ref($json->{result}[0]) ne "HASH");
if (defined($json->{result}[0]{events})) {
readingsSingleUpdate( $hash, "event", $json->{result}[0]{events}[0], 1 ) if(defined($json->{result}[0]{events}[0]));
}
my $laststate = ReadingsVal($name, "state","-");
if(($laststate ne "Docked" && $laststate ne "Charging") && defined($json->{result}[0]{state}) && $json->{result}[0]{state} eq "8")
{
@ -3158,6 +3162,10 @@ sub XiaomiDevice_DbLog_splitFn($) {
<br>
Error code<br/>
</li><br>
<li><code>event</code> <i>(VacuumCleaner)</i>
<br>
Last event (e.g., bin_full)<br/>
</li><br>
<li><code>consumables_X</code> <i>(VacuumCleaner)</i>
<br>
Consumables time remaining in %<br/>