From 0a29f3ca0ef5b4dc8c2c55f8a8ef0429c7b49421 Mon Sep 17 00:00:00 2001 From: H Plato Date: Fri, 9 Dec 2016 10:31:44 -0700 Subject: [PATCH 1/2] Replaced smartmatch operators to remove experimental dependancy for 4.2 --- lib/Owfs_Item.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/Owfs_Item.pm b/lib/Owfs_Item.pm index 647f998d3..1e5e06563 100644 --- a/lib/Owfs_Item.pm +++ b/lib/Owfs_Item.pm @@ -1127,12 +1127,12 @@ sub convert_value { my $location = $self->{location}; my $channel = $self->{channel}; my $value = $state; - $value = 1 if ( $state ~~ $ON ); - $value = 0 if ( $state ~~ $OFF ); - $value = 1 if ( $state ~~ main::ON ); - $value = 0 if ( $state ~~ main::OFF ); - $value = 1 if ( $state ~~ 'yes' ); - $value = 0 if ( $state ~~ 'no' ); + $value = 1 if ( lc $state eq lc $ON ); #( $state ~~ $ON ); + $value = 0 if ( lc $state eq lc $OFF ); #( $state ~~ $OFF ); + $value = 1 if ( lc $state eq main::ON ); #( $state ~~ main::ON ); + $value = 0 if ( lc $state eq main::OFF ); #( $state ~~ main::OFF ); + $value = 1 if (lc $state eq 'yes' ); #( $state ~~ 'yes' ); + $value = 0 if (lc $state eq 'no' ); #( $state ~~ 'no' ); if ( ( $value ne 1 ) && ( $value ne 0 ) ) { my $debug = $self->{debug} || $main::Debug{owfs}; &main::print_log( From bb9325f7bbcec0b56f55379db86392f395e3b315 Mon Sep 17 00:00:00 2001 From: H Plato Date: Fri, 9 Dec 2016 12:51:02 -0700 Subject: [PATCH 2/2] Added in missing package definitions --- lib/Owfs_Item.pm | 40 +++++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/lib/Owfs_Item.pm b/lib/Owfs_Item.pm index 1e5e06563..f73f2f15e 100644 --- a/lib/Owfs_Item.pm +++ b/lib/Owfs_Item.pm @@ -505,11 +505,11 @@ sub _dump { &main::print_log("id: \t\t$$self{id}") if $main::Debug{owfs}; &main::print_log("type: \t\t$$self{type}") if $main::Debug{owfs}; for my $key ( sort keys %$self ) { - next if ( $key eq "root" ); - next if ( $key eq "path" ); - next if ( $key eq "family" ); - next if ( $key eq "id" ); - next if ( $key eq "type" ); + next if ( $key eq "root" ); + next if ( $key eq "path" ); + next if ( $key eq "family" ); + next if ( $key eq "id" ); + next if ( $key eq "type" ); &main::print_log("$key:\t\t$$self{$key}") if $main::Debug{owfs}; } &main::print_log("\n") if $main::Debug{owfs}; @@ -1127,12 +1127,12 @@ sub convert_value { my $location = $self->{location}; my $channel = $self->{channel}; my $value = $state; - $value = 1 if ( lc $state eq lc $ON ); #( $state ~~ $ON ); - $value = 0 if ( lc $state eq lc $OFF ); #( $state ~~ $OFF ); - $value = 1 if ( lc $state eq main::ON ); #( $state ~~ main::ON ); - $value = 0 if ( lc $state eq main::OFF ); #( $state ~~ main::OFF ); - $value = 1 if (lc $state eq 'yes' ); #( $state ~~ 'yes' ); - $value = 0 if (lc $state eq 'no' ); #( $state ~~ 'no' ); + $value = 1 if ( lc $state eq lc $ON ); #( $state ~~ $ON ); + $value = 0 if ( lc $state eq lc $OFF ); #( $state ~~ $OFF ); + $value = 1 if ( lc $state eq main::ON ); #( $state ~~ main::ON ); + $value = 0 if ( lc $state eq main::OFF ); #( $state ~~ main::OFF ); + $value = 1 if ( lc $state eq 'yes' ); #( $state ~~ 'yes' ); + $value = 0 if ( lc $state eq 'no' ); #( $state ~~ 'no' ); if ( ( $value ne 1 ) && ( $value ne 0 ) ) { my $debug = $self->{debug} || $main::Debug{owfs}; &main::print_log( @@ -1533,6 +1533,15 @@ sub new { return $self; } +package Owfs_DS2405_pio; +use strict; + +our $ON = 'on'; +our $OFF = 'off'; +our $PIO = 0; +our $SENSE = 1; +our $LATCH = 2; + @Owfs_DS2405_pio::ISA = ('Owfs_Switch'); sub new { @@ -1542,6 +1551,15 @@ sub new { return $self; } +package Owfs_DS2405_sense; +use strict; + +our $ON = 'on'; +our $OFF = 'off'; +our $PIO = 0; +our $SENSE = 1; +our $LATCH = 2; + @Owfs_DS2405_sense::ISA = ('Owfs_Switch'); sub new {