diff --git a/README.md b/README.md index a987e55..1f9f29b 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ Jusqu'a présent, les fonctionalités suivantes ont été implémentées : - DHCP - FTP - System + - LCD - NAT - Dmz - Port Forwarding @@ -75,6 +76,7 @@ Les exemples sont disponibles dans le repertoire `exemple`. Ils sont classés pa - `DMZ` : Récupération de la confiugration de votre zone démilitarisée - `IncomingPort` : Retourne la configuration actuelle du port d'entrée HTTP - `PortForwarding` : Exemple d'ajout d'une redirection de port + - `LCD` : Exemple de modification de la luminosité du cadrant LCD de la freebox server - `download` - `dl_rss` : Un script qui parse les flux RSS et qui rajoute en téléchagement les items correspondant a une expression réguliere diff --git a/exemple/config/LCD.php b/exemple/config/LCD.php new file mode 100644 index 0000000..0f6ba71 --- /dev/null +++ b/exemple/config/LCD.php @@ -0,0 +1,18 @@ +authorize(); +$App->openSession(); + +// DMZ +$LCDService = new \alphayax\freebox\api\v3\services\config\LCD( $App); +$a = $LCDService->getConfiguration(); +var_dump( $a); + +$a->setBrightness( 10); +$b = $LCDService->setConfiguration( $a); +var_dump( $b); diff --git a/freebox/api/v3/models/LCDConfig.php b/freebox/api/v3/models/LCDConfig.php new file mode 100644 index 0000000..376de35 --- /dev/null +++ b/freebox/api/v3/models/LCDConfig.php @@ -0,0 +1,63 @@ +brightness; + } + + /** + * @param int $brightness + */ + public function setBrightness( $brightness){ + $this->brightness = $brightness; + } + + /** + * @return boolean + */ + public function isOrientationForced(){ + return $this->orientation_forced; + } + + /** + * @param boolean $orientation_forced + */ + public function setOrientationForced( $orientation_forced){ + $this->orientation_forced = $orientation_forced; + } + + /** + * @return int + */ + public function getOrientation(){ + return $this->orientation; + } + + /** + * @param int $orientation + */ + public function setOrientation( $orientation){ + $this->orientation = $orientation; + } + + +} \ No newline at end of file diff --git a/freebox/api/v3/services/config/LCD.php b/freebox/api/v3/services/config/LCD.php new file mode 100644 index 0000000..1d7c99e --- /dev/null +++ b/freebox/api/v3/services/config/LCD.php @@ -0,0 +1,35 @@ +getAuthService( self::API_LCD_CONFIG); + $rest->GET(); + + return new LCDConfig( $rest->getCurlResponse()['result']); + } + + /** + * @param LCDConfig $lcdConfig + * @return LCDConfig + */ + public function setConfiguration( LCDConfig $lcdConfig){ + $rest = $this->getAuthService( self::API_LCD_CONFIG); + $rest->PUT( $lcdConfig->toArray()); + + return new LCDConfig( $rest->getCurlResponse()['result']); + } + +} \ No newline at end of file