From 3a1effb81cb86f0d65393079970ea7c2fffdfef1 Mon Sep 17 00:00:00 2001
From: MarkusF <>
Date: Tue, 6 Feb 2018 19:11:13 +0000
Subject: [PATCH] 51_MOBILEALERTS.pm:Added directionInt for MA10660 and Migrate
to readingsDelete 50_MOBILEALERTSGW.pm:Migrate to readingsDelete
git-svn-id: https://svn.fhem.de/fhem/trunk@16104 2b470e98-0d58-463d-a4d8-8e2adae1ed80
---
fhem/CHANGED | 2 ++
fhem/FHEM/50_MOBILEALERTSGW.pm | 2 +-
fhem/FHEM/51_MOBILEALERTS.pm | 17 +++++++++--------
3 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/fhem/CHANGED b/fhem/CHANGED
index b859edd85..b3b964a55 100644
--- a/fhem/CHANGED
+++ b/fhem/CHANGED
@@ -1,5 +1,7 @@
# 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: 51_MOBILEALERTS: Added directionInt for MA10660
+ - changed: 50_MOBILEALERTSGW/51_MOBILEALERTS: Migrate to readingsDelete
- new: 98_freezemon: initial check-in
- feature: 74_Unifi: added voucher-functions
- change: 30_MilightBridge: Use new RemoveInternalTimer function
diff --git a/fhem/FHEM/50_MOBILEALERTSGW.pm b/fhem/FHEM/50_MOBILEALERTSGW.pm
index 49394e1b4..7300f0e8a 100644
--- a/fhem/FHEM/50_MOBILEALERTSGW.pm
+++ b/fhem/FHEM/50_MOBILEALERTSGW.pm
@@ -150,7 +150,7 @@ sub MOBILEALERTSGW_Set ($$@) {
if ( $cmd eq "clear" ) {
if ( $args[0] eq "readings" ) {
for ( keys %{ $hash->{READINGS} } ) {
- delete $hash->{READINGS}->{$_} if ( $_ ne 'state' );
+ readingsDelete($hash, $_) if ( $_ ne 'state' );
}
return undef;
}
diff --git a/fhem/FHEM/51_MOBILEALERTS.pm b/fhem/FHEM/51_MOBILEALERTS.pm
index b50f0e501..b43438e26 100644
--- a/fhem/FHEM/51_MOBILEALERTS.pm
+++ b/fhem/FHEM/51_MOBILEALERTS.pm
@@ -113,7 +113,7 @@ sub MOBILEALERTS_Set ($$@) {
if ( $cmd eq "clear" ) {
if ( $args[0] eq "readings" ) {
for ( keys %{ $hash->{READINGS} } ) {
- delete $hash->{READINGS}->{$_} if ( $_ ne 'state' );
+ readingsDelete($hash, $_) if ( $_ ne 'state' );
}
return undef;
}
@@ -210,7 +210,7 @@ sub MOBILEALERTS_Parse ($$) {
sub MOBILEALERTS_Parse_02_ce ($$) {
my ( $hash, $message ) = @_;
MOBILEALERTS_readingsBulkUpdateIfChanged( $hash, 0, "deviceType",
- "MA10100" );
+ "MA10100/MA10101" );
MOBILEALERTS_Parse_ce( $hash, $message );
}
@@ -520,6 +520,7 @@ sub MOBILEALERTS_Parse_e2 ($$) {
MOBILEALERTS_readingsBulkUpdate( $hash, 0, "txCounter",
MOBILEALERTS_decodeTxCounter($txCounter) );
MOBILEALERTS_readingsBulkUpdate( $hash, 0, "direction", $dirTable[$dir] );
+ MOBILEALERTS_readingsBulkUpdate( $hash, 0, "directionInt", $dir );
MOBILEALERTS_readingsBulkUpdate( $hash, 0, "windSpeed", $windSpeed );
MOBILEALERTS_readingsBulkUpdate( $hash, 0, "gustSpeed", $gustSpeed );
MOBILEALERTS_readingsBulkUpdate( $hash, 0, "state",
@@ -831,7 +832,7 @@ sub MOBILEALERTS_convertEventTimeString($$) {
sub MOBILEALERTS_readingsBulkUpdate($$$$@) {
my ( $hash, $expert, $reading, $value, $changed ) = @_;
if ( $expert > $hash->{".expertMode"} ) {
- delete $hash->{READINGS}{$reading};
+ readingsDelete($hash, $reading);
return undef;
}
my $i = $#{ $hash->{CHANGED} };
@@ -845,7 +846,7 @@ sub MOBILEALERTS_readingsBulkUpdate($$$$@) {
sub MOBILEALERTS_readingsBulkUpdateIfChanged($$$$@) {
my ( $hash, $expert, $reading, $value, $changed ) = @_;
if ( $expert > $hash->{".expertMode"} ) {
- delete $hash->{READINGS}{$reading};
+ readingsDelete($hash, $reading);
return undef;
}
my $i = $#{ $hash->{CHANGED} };
@@ -1033,7 +1034,7 @@ sub MOBILEALERTS_ActionDetector($) {
The MOBILEALERTS is a fhem module for the german MobileAlerts devices and TFA WEATHERHUB devices.
The fhem module represents a MobileAlerts device. The connection is provided by the MOBILELAERTSGW module.
- Currently supported: MA10100, MA10200, MA10230, MA10300, MA10650, MA10320PRO, MA10350, MA10410, MA10450, MA10660, MA10700, TFA 30.3312.02, MA10800, WL2000
+ Currently supported: MA10100, MA10101, MA10200, MA10230, MA10300, MA10650, MA10320PRO, MA10350, MA10410, MA10450, MA10660, MA10700, TFA 30.3312.02, MA10800, WL2000
Supported but untested: ./.
@@ -1063,7 +1064,7 @@ sub MOBILEALERTS_ActionDetector($) {