Open felagund opened 3 years ago
@KarimGeiger I noticed in other issues you do not get notifications so here I am trying to send you one.
Also, I have a question - any idea how one could turn the device off instead of putting it to sleep? Becasue putting it to sleep is what $hk->zone('Main Zone')->off();
does.
Thank you for the library. It works with my 151S AVR model.
I have never used php before so it took me a bit to set it up, my streamlined notes on a Ubuntu/Debian are below. My use case was to be able to use a script to turn the AVR off when I turn my Raspberry Pi off automatically. This accomplishes it:
sudo apt install composer
mkdir my_avr_script ; cd my_avr_script
<?php require DIR . '/vendor/autoload.php'; echo "Hello World!'\n"; $hk = new \HKAPI\API('192.168.2.206',10025, new \HKAPI\Devices\AVR()); sleep(3); $hk->zone('Main Zone')->off(); ?>
Hello World! PHP Notice: Undefined offset: 0 in /home/pi/skripty_na_AVR/vendor/karimgeiger/hkapi/lib/Zone.php on line 95