diff --git a/fhem/CHANGED b/fhem/CHANGED
index 994036fee..39ddd82ce 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: 98_Verkehrsinfo.pm: add attribut disable
- feature: allowed: multi-allowed changes (Forum #92423)
- feature: 93_DbRep: V8.4.0, reduceLog from DbLog integrated into DbRep,
sqlCmd/dbValue with textField-long as default, both
diff --git a/fhem/FHEM/98_Verkehrsinfo.pm b/fhem/FHEM/98_Verkehrsinfo.pm
index 9d0738a4e..ff6917b45 100644
--- a/fhem/FHEM/98_Verkehrsinfo.pm
+++ b/fhem/FHEM/98_Verkehrsinfo.pm
@@ -25,6 +25,9 @@
############################################################################
#
# Changelog:
+# 2018-10-21, v2.3
+# Feature: Attribut disable added
+#
# 2017-01-16, v2.2
# Feature: Quelle http://www.radiosaw.de/verkehrsmeldungen added
#
@@ -119,6 +122,7 @@ sub Verkehrsinfo_Initialize($) {
$hash->{AttrList} =
"filter_exclude filter_include orderby "
. "msg_format:road,head,both "
+ . "disable:1,0 "
. $readingFnAttributes;
}
@@ -260,6 +264,7 @@ sub Verkehrsinfo_Set($@) {
sub Verkehrsinfo_Attr(@) {
my ($cmd,$name,$attr_name,$attr_value) = @_;
+ my $hash = $defs{$name};
if($cmd eq "set") {
if($attr_name eq "filter_exclude" || $attr_name eq "filter_include") {
eval { qr/$attr_value/ };
@@ -279,6 +284,23 @@ sub Verkehrsinfo_Attr(@) {
Log3 $name, 3, $err;
return $err;
}
+ elsif ( $attr_name eq "disable" ) {
+ if ( $attr_value == 1 ) {
+ RemoveInternalTimer($hash);
+ readingsSingleUpdate( $hash, "state", "inactive", 1 );
+ $hash->{helper}{DISABLED} = 1;
+ }
+ elsif ( $attr_value == 0 ) {
+ readingsSingleUpdate( $hash, "state", "active", 1 );
+ Verkehrsinfo_GetUpdate($hash);
+ }
+
+ }
+ }
+ elsif ( $cmd eq "del" ) {
+ if ( $attr_name eq "disable" ) {
+ Verkehrsinfo_GetUpdate($hash);
+ }
}
return undef;
}
@@ -703,6 +725,8 @@ sub Verkehrsinfo_hf_orderby ($@) {
Multiple searching keywords can be seperated with the pipe "|".