From 195c36d81cb516112e589b90f5846ee601d950fe Mon Sep 17 00:00:00 2001
From: Ellert <>
Date: Sat, 18 May 2024 10:19:53 +0000
Subject: [PATCH] AutomowerConnect: cref update, changes regarding the
appearance of reading mower_inactiveReason
git-svn-id: https://svn.fhem.de/fhem/trunk@28885 2b470e98-0d58-463d-a4d8-8e2adae1ed80
---
fhem/CHANGED | 1 +
fhem/FHEM/74_AutomowerConnect.pm | 2 ++
fhem/lib/FHEM/Devices/AMConnect/Common.pm | 5 +++--
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/fhem/CHANGED b/fhem/CHANGED
index d90ad8591..b6a0ee85e 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
+ - change: 74_AutomowerConnect: minor changes
- feature: 76_SolarForecast: currentMeterDev: contotal and feedtotal can be
reset at day begin (day meter)
- feature: 76_SolarForecast: graphicBeamXContent: gridfeedin available,
diff --git a/fhem/FHEM/74_AutomowerConnect.pm b/fhem/FHEM/74_AutomowerConnect.pm
index 71cb6b1ae..ad99ae742 100644
--- a/fhem/FHEM/74_AutomowerConnect.pm
+++ b/fhem/FHEM/74_AutomowerConnect.pm
@@ -556,6 +556,7 @@ __END__
mower_commandSend - Last successfull sent command
mower_commandStatus - Status of the last sent command cleared each status update
mower_currentZone - Zone name with activity MOWING in the last status time stamp interval and number of way points in parenthesis.
+ mower_inactiveReason - They are NONE, PLANNING, SEARCHING_FOR_SATELLITES.
mower_wsEvent - websocket connection events (status-event, positions-event, settings-event)
mower_errorCode - last error code
mower_errorCodeTimestamp - last error code time stamp
@@ -1044,6 +1045,7 @@ __END__
mower_commandSend - Letzter erfolgreich gesendeter Befehl.
mower_commandStatus - Status des letzten uebermittelten Kommandos wird duch Statusupdate zurückgesetzt.
mower_currentZone - Name der Zone im aktuell abgefragten Intervall der Statuszeitstempel , in der der Mäher gemäht hat und Anzahl der Wegpunkte in der Zone in Klammern.
+ mower_inactiveReason - Gründe für Inaktivität: NONE, PLANNING, SEARCHING_FOR_SATELLITES.
mower_wsEvent - Events der Websocketverbindung (status-event, positions-event, settings-event)
mower_errorCode - last error code
mower_errorCodeTimestamp - last error code time stamp
diff --git a/fhem/lib/FHEM/Devices/AMConnect/Common.pm b/fhem/lib/FHEM/Devices/AMConnect/Common.pm
index 6a56571a7..67bddfcfc 100644
--- a/fhem/lib/FHEM/Devices/AMConnect/Common.pm
+++ b/fhem/lib/FHEM/Devices/AMConnect/Common.pm
@@ -2374,10 +2374,11 @@ sub fillReadings {
readingsBulkUpdateIfChanged( $hash, '.mower_id', $hash->{helper}{mower}{id}, 0 );
readingsBulkUpdateIfChanged( $hash, "batteryPercent", $hash->{helper}{mower}{attributes}{battery}{batteryPercent} );
my $pref = 'mower';
+ my $rval = ReadingsVal( $name, $pref.'_inactiveReason', '' );
- if ( ! ReadingsVal( $name, $pref.'_inactiveReason', '' ) && $hash->{helper}{mower}{attributes}{$pref}{inactiveReason} ne 'NONE' ) {
+ if ( !$rval && $hash->{helper}{mower}{attributes}{$pref}{inactiveReason} ne 'NONE' ) {
readingsBulkUpdateIfChanged( $hash, $pref.'_inactiveReason', $hash->{helper}{mower}{attributes}{$pref}{inactiveReason} );
- } else {
+ } elsif ( $rval ) {
readingsBulkUpdateIfChanged( $hash, $pref.'_inactiveReason', $hash->{helper}{mower}{attributes}{$pref}{inactiveReason} );
}