Код: Выделить всё
file_get_contents("http://".$this->getProperty('ipAddress')."/".$this->getProperty('Password')."/?cmd=".$this->getProperty('Port').":2");
$state = file_get_contents("http://".$this->getProperty('ipAddress')."/".$this->getProperty('Password')."/?pt=".$this->getProperty('Port')."&cmd=get");
$Port = $this->getProperty('Port');
$Letter = substr($Port, -1);
if ($Letter == "A") {
$state = substr($state,0,2);
}
if ($Letter == "B") {
$state = substr($state, -2);
}
if ($state == "ON") {
$this->setProperty('Status', 1);
} else {
$this->setProperty('Status', 0); }