Skip to content

Commit

Permalink
support "disabled" option in breakTime plugin (#801)
Browse files Browse the repository at this point in the history
  • Loading branch information
allanon committed Jul 30, 2017
1 parent 4d54641 commit a83c5ae
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plugins/breakTime/breakTime.pl
Expand Up @@ -25,6 +25,9 @@ sub mainLoop_pre {
debug sprintf("autoBreakTime: %s %s:%s\n", $wdays[$wday], $hour, $min), __PACKAGE__, 2;
for (my $i = 0 and my $prefix; exists $config{$prefix = "autoBreakTime_$i"}; $i++) {
next unless split /\s+/, $config{$prefix} =~ /all|$wdays[$wday]/i;

# Prefer to use Misc::checkSelfCondition but it requires that the AI is turned on. breakTime should work when the AI is off as well.
next if $config{"${prefix}_disabled"};

my ($now, $start, $stop) = map { sub { ($_[0]*60 + $_[1])*60 } ->(@$_) } [$hour, $min], map {[split /:/]} (
$config{"${prefix}_startTime"}, $config{"${prefix}_stopTime"}
Expand Down

0 comments on commit a83c5ae

Please sign in to comment.