Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for enabling/disabling the pesky status LEDs on the Inste… #536

Merged
merged 1 commit into from
Nov 15, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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