#!/usr/bin/php <?php /* Load Composer's Autoloader */ use Hue\Hue; $composerAutoload = [__DIR__ . '/../vendor/autoload.php', __DIR__ . '/../../autoload.php']; foreach ($composerAutoload as $autoload) { if (file_exists($autoload)) { require_once $autoload; break; } } $bridge = '192.168.0.162'; $key = "replace_this_with_a_real_key"; $hue = new Hue($bridge, $key); $light = 1; $hue->lights()[$light]->setAlert("lselect"); sleep(2); $hue->lights()[$light]->setAlert("none");
#!/usr/bin/php <?php /* Load Composer's Autoloader */ use Hue\Hue; $composerAutoload = [__DIR__ . '/../vendor/autoload.php', __DIR__ . '/../../autoload.php']; foreach ($composerAutoload as $autoload) { if (file_exists($autoload)) { require_once $autoload; break; } } $bridge = '192.168.0.162'; $key = "replace_this_with_a_real_key"; $hue = new Hue($bridge, $key); $lightRange = [1, 3]; while (true) { $target = rand($lightRange[0], $lightRange[1]); $command = array('ct' => rand(350, 500), 'bri' => rand(25, 75)); $hue->lights()[$target]->setLight($command); usleep(100000); }
#!/usr/bin/php <?php /* Load Composer's Autoloader */ use Hue\Hue; $composerAutoload = [__DIR__ . '/../vendor/autoload.php', __DIR__ . '/../../autoload.php']; foreach ($composerAutoload as $autoload) { if (file_exists($autoload)) { require_once $autoload; break; } } $bridge = '192.168.0.162'; $key = "replace_this_with_a_real_key"; $hue = new Hue($bridge, $key); $light = 1; $hue->lights()[$light]->setLight($hue->predefinedColors('green')); sleep(1); $hue->lights()[$light]->setLight($hue->predefinedColors('red')); sleep(1); $hue->lights()[$light]->setLight($hue->predefinedColors('blue')); sleep(1); $hue->lights()[$light]->setLight($hue->predefinedColors('purple')); sleep(1); $hue->lights()[$light]->setLight($hue->predefinedColors('pink')); sleep(1); $hue->lights()[$light]->setLight($hue->predefinedColors('yellow')); sleep(1); $hue->lights()[$light]->setLight($hue->predefinedColors('orange')); sleep(1); $hue->lights()[$light]->setLight($hue->predefinedColors('coolwhite')); sleep(1);
#!/usr/bin/php <?php /* Load Composer's Autoloader */ use Hue\Hue; $composerAutoload = [__DIR__ . '/../vendor/autoload.php', __DIR__ . '/../../autoload.php']; foreach ($composerAutoload as $autoload) { if (file_exists($autoload)) { require_once $autoload; break; } } $bridge = '192.168.0.162'; $key = "replace_this_with_a_real_key"; $hue = new Hue($bridge, $key); $lightRange = [1, 2]; while (true) { $target = rand($lightRange[0], $lightRange[1]); $hue->lights()[$target]->setLight($hue->randomColor()); usleep(100000); }