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

Update master with tasmota and rrd updates #843

Merged
merged 16 commits into from
Feb 2, 2022
Merged
Show file tree
Hide file tree
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
10 changes: 8 additions & 2 deletions bin/get_url
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use Getopt::Long;
#print "get_url: @ARGV\n";
if (
!&GetOptions( \%parms, 'h', 'help', 'quiet', 'cookies=s', 'cookie_file_in=s', 'cookie_file_out=s', 'post=s', 'header=s', 'userid=s', 'password=s', 'ua',
'put=s', 'timeout=s', 'json', 'response_code' )
'put=s', 'timeout=s', 'json', 'response_code', 'status_line' )
or !@ARGV
or $parms{h}
or $parms{help}
Expand Down Expand Up @@ -58,7 +58,9 @@ Usage:

-header 'header_file': HTTP headers from the server are stored in this file

-response_code: STDOUT only: Prepend output with RESPONSECODE: <response code>\n
-response_code: Prepend output with RESPONSECODE: <response code>\n

-status_line: Prepend output with STATUSLINE: <status line>\n. Status line will still be printed if error

-timeout: XX : number of seconds to wait for command to complete

Expand Down Expand Up @@ -91,6 +93,8 @@ if ( ( $config_parms{get_url} eq 'useragent' )
or $parms{header}
or $parms{cookies}
or $parms{ua}
or $parms{response_code}
or $parms{status_line}
or $parms{cookie_file_out}
or $parms{password} )
{
Expand Down Expand Up @@ -187,6 +191,8 @@ sub use_ua {
else {
$response = $ua->request($request);
print "RESPONSECODE:" . $response->code() . "\n" if ( $parms{response_code} );
print "STATUSLINE:" . $response->status_line() . "\n" if ( $parms{status_line} );

print $response->content();
}
if ( $response->is_error() ) {
Expand Down
44 changes: 44 additions & 0 deletions lib/Generic_Item.pm
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ sub new {
if ( defined $main::config_parms{object_logger_enable} );
$self->{logger_mintime} = 1;
$self->{logger_updatetime} = 0;
$self->{rrdfile} = undef; #if an rrdfile is attached to the object, then it can be displayed in the ia7 interface
$self->restore_data( 'active_state', 'schedule_count' );

for my $index ( 1 .. 20 ) {
Expand Down Expand Up @@ -1167,6 +1168,49 @@ sub logger {
$self->{logger_updatetime} = $tickcount;
}

=item C<set_rrd()>

Attach a rrd filename, and data source (ds) names to the object. Used to display a graph in the IA7 interface

=cut

sub set_rrd {
my ( $self, $rrdfile, $ds) = @_;

$self->{rrdfile} = $rrdfile;
$self->{rrdds} = $ds;

}

=item C<get_rrd()>

Get the rrd filename attached to the object.


=cut

sub get_rrd {
my ( $self) = @_;

return $self->{rrdfile};

}

=item C<get_rrd()>

Get the rrd datasources attached to the object.


=cut

sub get_rrd_ds {
my ( $self) = @_;

return $self->{rrdds};

}


=item C<reset_states2()>

TODO
Expand Down
1 change: 1 addition & 0 deletions lib/Group.pm
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ sub new {
$$self{members} = [];
&add( $self, @items ) if @items;
$self->{logger_enable} = $main::config_parms{object_logger_group} if ( defined $main::config_parms{object_logger_group} );

bless $self, $class;
return $self;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Insteon/BaseInsteon.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3109,7 +3109,7 @@ sub add {
and ( $obj->isa('Light_Item') or $obj->isa('Insteon::BaseDevice') ) )
{
if ( $$self{members} && $$self{members}{$obj} ) {
print "[Insteon::BaseController] An object (" . $obj->{object_name} . ") already exists " . "in this scene. Aborting add request.\n";
print "[Insteon::BaseController] An object (" . $obj->{object_name} . ":" . $obj->{device_id} . ") already exists " . "in this scene (" . $self->{object_name} . "). Aborting add request.\n";
return;
}
if ( $on_level =~ /^sur/i ) {
Expand Down
Loading