Skip to content

Commit

Permalink
Merge pull request #694 from hplato/razberry
Browse files Browse the repository at this point in the history
added object logger support
  • Loading branch information
hplato authored May 30, 2017
2 parents e7effbd + 43ea3eb commit 097d8a0
Showing 1 changed file with 16 additions and 13 deletions.
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

0 comments on commit 097d8a0

Please sign in to comment.