Example #1
0
 public function testLightColorChange()
 {
     $this->initialise();
     $this->testLightOn();
     $light = HouseLight::where('light_id', 1)->first();
     $this->assertInstanceOf('App\\HouseLight', $light);
     $color = LightSetting::all()->random(1);
     $this->assertInstanceOf('App\\LightSetting', $color);
     $job = new SetLightColor($light->light_id, $color->x, $color->y);
     $this->dispatch($job);
     $this->seeInDatabase('lights', ['light_id' => $light->light_id, 'state' => '1', 'xy' => $color->x . ',' . $color->y]);
     $this->testLightOff();
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $lightsettings = LightSetting::all();
     return view('lightsettings.index', compact('lightsettings'));
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $lights = HouseLight::all();
     $settings = LightSetting::all();
     return view('home', compact('lights', 'settings'));
 }