Exemplo n.º 1
0
function light_notification($call = true)
{
    $lights = Light::allLights();
    $pattern = $lights->isOn();
    if ($call) {
        $number = 2;
    } else {
        $number = 3;
    }
    for ($i = 0; $i < $number; $i++) {
        $lights->on(true);
        sleep(1);
        $lights->on(false);
        sleep(1);
    }
    $lights->status($pattern);
}