Branch Coverage

blib/lib/Device/Plugwise.pm
Criterion Covered Total %
branch 38 116 32.7


line true false branch
44 1 0 if (exists $p{'filehandle'}) { }
55 0 1 if (not defined $msg or $msg ne 'connected' and not exists $p{'filehandle'})
63 1 0 if exists $p{'dont_scan_network'}
93 0 0 if ($$self{'device'} =~ m([/\\])) { }
97 0 0 if ($$self{'device'} eq 'discover')
113 0 0 if ($dev =~ s/:(\d+)$//)
116 0 0 unless my $fh = 'IO::Socket::INET'->new($dev . ':' . $self->port)
134 0 0 unless sysopen $fh, $$self{'device'}, 2306
144 2 1 if defined $res
149 0 1 unless $sel->can_read($timeout)
152 1 0 if defined $timeout
153 0 0 defined $bytes ? :
0 1 unless $bytes
155 1 0 if defined $res and not $$self{'_awaiting_stick_response'}
157 1 0 if defined $res
164 1 3 unless $$rbuf
168 0 3 unless $$rbuf =~ s/\x05\x05\x03\x03(\w+)\r\n//
172 3 0 if ($body eq 'ack')
173 0 3 unless $$rbuf =~ s/\x05\x05\x03\x03(\w+)\r\n//
178 3 0 unless $no_write or $$self{'_awaiting_stick_response'}
189 2 1 unless $$self{'_waiting'}
203 3 3 if ($wait_rec and $$wait_rec[1])
205 0 3 if $cb
207 3 3 unless defined $rec
254 0 6 unless ($self->_plugwise_crc(substr($frame, 0, -4)) eq substr($frame, -4, 4))
274 3 3 if ($frame =~ /^0000([[:xdigit:]]{4})([[:xdigit:]]{4})$/)
280 3 0 if ($2 eq '00C1') { }
0 0 elsif ($2 eq '00C2') { }
306 0 0 if ($msg_causing_error =~ /^0026([[:xdigit:]]{16}$)/)
332 1 2 if ($frame =~ /^0011([[:xdigit:]]{4})([[:xdigit:]]{16})([[:xdigit:]]{4})([[:xdigit:]]{16})([[:xdigit:]]{4})/)
353 1 1 if ($frame =~ /^0000([[:xdigit:]]{4})00DE([[:xdigit:]]{16})$/)
371 1 0 if ($frame =~ /^0000([[:xdigit:]]{4})00D8([[:xdigit:]]{16})$/)
388 0 0 if ($frame =~ /^0013([[:xdigit:]]{4})([[:xdigit:]]{16})([[:xdigit:]]{4})([[:xdigit:]]{4})/)
402 0 0 unless (defined $$self{'_plugwise'}{'circles'}{$saddr}{'gainA'})
441 0 0 if ($frame =~ /^0019([[:xdigit:]]{4})([[:xdigit:]]{16})([[:xdigit:]]{16})([[:xdigit:]]{2})$/)
446 0 0 if ($3 ne 'FFFFFFFFFFFFFFFF')
462 0 0 if ($frame =~ /^0024([[:xdigit:]]{4})([[:xdigit:]]{16})([[:xdigit:]]{8})([[:xdigit:]]{8})([[:xdigit:]]{2})/)
467 0 0 $5 eq '00' ? :
468 0 0 $5 eq '00' ? :
497 0 0 if ($frame =~ /^0027([[:xdigit:]]{4})([[:xdigit:]]{16})([[:xdigit:]]{8})([[:xdigit:]]{8})([[:xdigit:]]{8})([[:xdigit:]]{8})$/)
526 0 0 if ($frame =~ /^0049([[:xdigit:]]{4})([[:xdigit:]]{16})([[:xdigit:]]{16})([[:xdigit:]]{16})([[:xdigit:]]{16})([[:xdigit:]]{16})([[:xdigit:]]{8})$/)
546 0 0 unless (defined $$self{'_plugwise'}{'circles'}{$s_id}{'gainA'})
563 0 0 if ($tstamp eq '000000000000')
611 0 2 unless (defined $command and defined $target)
626 2 0 if (defined $target)
633 1 1 if ($command eq 'on') { }
1 0 elsif ($command eq 'off') { }
0 0 elsif ($command eq 'status') { }
0 0 elsif ($command eq 'livepower') { }
0 0 elsif ($command eq 'history') { }
647 0 0 unless (defined $$self{'_plugwise'}{'circles'}{$circle}{'offruis'})
664 0 0 unless (defined $$self{'_plugwise'}{'circles'}{$circle}{'offruis'})
674 0 0 unless (defined $parameter)
693 2 0 if defined $packet
787 0 0 if ($data =~ /^([[:xdigit:]]{8})([[:xdigit:]]{8})$/)
812 0 0 if $tstamp eq 'FFFFFFFF'
815 0 0 if ($tstamp =~ /([[:xdigit:]]{2})([[:xdigit:]]{2})([[:xdigit:]]{4})/) { }
868 0 0 if $out < 0