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

added object logger support #694

Merged
merged 1 commit into from
May 30, 2017
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
29 changes: 16 additions & 13 deletions lib/raZberry.pm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

=head1 B<raZberry> v2.0.1
=head1 B<raZberry> v2.0.2

=head2 SYNOPSIS

Expand Down Expand Up @@ -112,6 +112,9 @@ http calls can cause pauses. There are a few possible options around this;


=head2 CHANGELOG
v2.0.2
- add generic items for logger

v2.0.1
- added full poll for getting battery data

Expand Down Expand Up @@ -193,9 +196,9 @@ $rest{controller} = "Data/*";

sub new {
my ( $class, $addr, $poll, $options ) = @_;
my $self = {};
my $self = new Generic_Item();
bless $self, $class;
&main::print_log("[raZberry]: v2.0.1 Controller Initializing...");
&main::print_log("[raZberry]: v2.0.2 Controller Initializing...");
$self->{data} = undef;
$self->{child_object} = undef;
$self->{config}->{poll_seconds} = 5;
Expand Down Expand Up @@ -694,7 +697,7 @@ package raZberry_dimmer;
sub new {
my ( $class, $object, $devid, $options ) = @_;

my $self = {};
my $self = new Generic_Item();
bless $self, $class;
push( @{ $$self{states} }, 'off', 'low', 'med', 'high', 'on', '10%', '20%', '30%', '40%', '50%', '60%', '70%', '80%', '90%' );

Expand Down Expand Up @@ -792,7 +795,7 @@ package raZberry_switch;
sub new {
my ( $class, $object, $devid, $options ) = @_;

my $self = {};
my $self = new Generic_Item();
bless $self, $class;
push( @{ $$self{states} }, 'off', 'on', );

Expand Down Expand Up @@ -879,7 +882,7 @@ package raZberry_blind;
sub new {
my ( $class, $object, $devid, $options ) = @_;

my $self = {};
my $self = new Generic_Item();
bless $self, $class;

$$self{master_object} = $object;
Expand Down Expand Up @@ -1051,7 +1054,7 @@ package raZberry_lock;
sub new {
my ( $class, $object, $devid, $options ) = @_;

my $self = {};
my $self = new Generic_Item();
bless $self, $class;
push( @{ $$self{states} }, 'locked', 'unlocked' );

Expand Down Expand Up @@ -1281,7 +1284,7 @@ sub new {

my ( $class, $object ) = @_;

my $self = {};
my $self = new Generic_Item();
bless $self, $class;

$$self{master_object} = $object;
Expand Down Expand Up @@ -1404,7 +1407,7 @@ package raZberry_temp_sensor;
sub new {
my ( $class, $object, $devid, $options ) = @_;

my $self = {};
my $self = new Generic_Item();
bless $self, $class;

$$self{master_object} = $object;
Expand Down Expand Up @@ -1456,7 +1459,7 @@ package raZberry_binary_sensor;
sub new {
my ( $class, $object, $devid, $options ) = @_;

my $self = {};
my $self = new Generic_Item();
bless $self, $class;

#push( @{ $$self{states} }, 'on', 'off'); I'm not sure we should set the states here, since it's not a controlable item?
Expand Down Expand Up @@ -1537,7 +1540,7 @@ package raZberry_battery;
sub new {
my ( $class, $object, $devid, $options ) = @_;

my $self = {};
my $self = new Generic_Item();
bless $self, $class;
push( @{ $$self{states} }, 'locked', 'unlocked' );

Expand Down Expand Up @@ -1610,7 +1613,7 @@ package raZberry_voltage;
sub new {
my ( $class, $object, $devid, $options ) = @_;

my $self = {};
my $self = new Generic_Item();
bless $self, $class;

#ZWayVDev_zway_x-0-50-0 - Power Meter kWh
Expand Down Expand Up @@ -1685,7 +1688,7 @@ package raZberry_generic;
sub new {
my ( $class, $object, $devid, $options ) = @_;

my $self = {};
my $self = new Generic_Item();
bless $self, $class;

$$self{master_object} = $object;
Expand Down