File Coverage

blib/lib/Device/RFXCOM/Response/HomeEasy.pm
Criterion Covered Total %
statement 24 24 100.0
branch 2 2 100.0
condition n/a
subroutine 12 12 100.0
pod 7 7 100.0
total 45 45 100.0


line stmt bran cond sub pod time code
1 4     4   21 use strict;
  4         6  
  4         144  
2 4     4   21 use warnings;
  4         8  
  4         214  
3             package Device::RFXCOM::Response::HomeEasy;
4             $Device::RFXCOM::Response::HomeEasy::VERSION = '1.142010';
5             # ABSTRACT: Device::RFXCOM::Response class for Home Easy message from RFXCOM receiver
6              
7              
8 4     4   70 use 5.006;
  4         29  
  4         176  
9 4     4   20 use constant DEBUG => $ENV{DEVICE_RFXCOM_RESPONSE_HOMEEASY_DEBUG};
  4         7  
  4         241  
10 4     4   24 use Carp qw/croak/;
  4         5  
  4         1024  
11              
12              
13             sub new {
14 3     3 1 9 my ($pkg, %p) = @_;
15 3         23 bless { %p }, $pkg;
16             }
17              
18              
19 4     4 1 11 sub type { 'homeeasy' }
20              
21              
22 4     4 1 21 sub address { shift->{address} }
23              
24              
25 4     4 1 13 sub unit { shift->{unit} }
26              
27              
28 4     4 1 12 sub command { shift->{command} }
29              
30              
31 5     5 1 43 sub level { shift->{level} }
32              
33              
34             sub summary {
35 4     4 1 6 my $self = shift;
36 4 100       12 sprintf('%s/%s.%s/%s%s',
37             $self->type,
38             $self->address,$self->unit,
39             $self->command,
40             $self->level ? '['.$self->level.']' : '');
41             }
42              
43             1;
44              
45             __END__