Skip to content

Commit

Permalink
[FHEMBUIENRADAR-46] support IsDisabled()
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Morrison committed Apr 12, 2020
1 parent 8b7b54d commit ad7f769
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
4 changes: 2 additions & 2 deletions CHANGED
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Last Buienradar updates (12.04.2020)
Last Buienradar updates (13.04.2020)
8b7b54d 12.04.2020 23:43 [FHEMBUIENRADAR-45] removed testVal()
3278350 12.04.2020 21:56 [FHEMBUIENRADAR-44] followed perlcritics guidelines in severity 5
183e202 08.01.2020 22:06 [FHEMBUIENRADAR-43] recalculate RainAmount as mm/h (Issue #9)
0019217 08.01.2020 21:45 [FHEMBUIENRADAR-39] update meta.json (Issue #11)
9883361 08.01.2020 21:43 [FHEMBUIENRADAR-39] added ColourBarChart
13b073b 08.01.2020 20:29 [FHEMBUIENRADAR-39] added bar chart
11 changes: 9 additions & 2 deletions FHEM/59_Buienradar.pm
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ use GPUtils qw(GP_Import GP_Export);
use experimental qw( switch );

our $device;
our $version = '2.3.1';
our $version = '2.3.2';
our $default_interval = ONE_MINUTE * 2;
our @errors;

Expand Down Expand Up @@ -303,11 +303,18 @@ sub Attr {
if ($attribute_value =~ /(on|1)/) {
::RemoveInternalTimer( $hash, "FHEM::Buienradar::Timer" );
$hash->{NEXTUPDATE} = undef;
$hash->{STATE} = "inactive";
# this is a workaround: ::IsDisabled checks only for "disable", but not for "disabled"
# so manually set $::attr{$device_name}{"disable"} without calling Buienradar::Attr
$::attr{$device_name}{"disable"} = 1;
return undef;
}

if ($attribute_value =~ /(off|0)/) {
Timer($hash);
# this is a workaround: ::IsDisabled checks only for "disable", but not for "disabled"
# so manually set $::attr{$device_name}{"disable"} without calling Buienradar::Attr
delete $::attr{$device_name}{"disable"};
return undef;
}
}
Expand Down Expand Up @@ -1170,7 +1177,7 @@ sub Debugging {
],
"release_status": "development",
"license": "Unlicense",
"version": "2.3.1",
"version": "2.3.2",
"author": [
"Christoph Morrison <[email protected]>"
],
Expand Down
2 changes: 1 addition & 1 deletion controls_Buienradar.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
DEL ./FHEM/59_Buienradar.pm
UPD 2020-04-12_23:41:22 41679 FHEM/59_Buienradar.pm
UPD 2020-04-13_00:23:49 42317 FHEM/59_Buienradar.pm
2 changes: 1 addition & 1 deletion meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
],
"release_status": "development",
"license": "Unlicense",
"version": "2.3.1",
"version": "2.3.2",
"author": [
"Christoph Morrison <[email protected]>"
],
Expand Down

0 comments on commit ad7f769

Please sign in to comment.