Skip to content

Commit

Permalink
Merge pull request #536 from Gribnif/master
Browse files Browse the repository at this point in the history
Add support for enabling/disabling the pesky status LEDs on the Inste…
  • Loading branch information
hollie committed Nov 15, 2015
2 parents d3e8649 + 8a31eda commit 0b2fbf4
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions lib/Insteon/Lighting.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1715,6 +1715,28 @@ sub is_acknowledged
}
}

=item C<enable_led(boolean)>
If boolean is true, status LEDs will be enabled.
=cut

sub enable_led
{
my ($self, $is_true) = @_;
return unless defined $is_true;
my $name = $self->get_object_name;

if ($is_true) {
::print_log("[Insteon::FanLinc] Enabling LEDs on $name. After doing this, you may have to turn both the fan and the light on/off in order for the change to take effect.");
$self->set_operating_flag('led_enabled');
}
else {
::print_log("[Insteon::FanLinc] Disabling LEDs on $name. After doing this, you may have to turn both the fan and the light on/off in order for the change to take effect.");
$self->set_operating_flag('led_off');
}
}

=item C<get_voice_cmds>
Returns a hash of voice commands where the key is the voice command name and the
Expand All @@ -1738,6 +1760,8 @@ sub get_voice_cmds
if ($self->is_root){
%voice_cmds = (
%voice_cmds,
'enable status LEDs' => "$object_name->enable_led(1)",
'disable status LEDs' => "$object_name->enable_led(0)",
'sync all device links' => "$object_name->sync_all_links()",
'AUDIT sync all device links' => "$object_name->sync_all_links(1)"
);
Expand Down

0 comments on commit 0b2fbf4

Please sign in to comment.