You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DummySensor.php 575B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: robin
  5. * Date: 11/24/15
  6. * Time: 12:49 AM
  7. */
  8. namespace App\Http\Business\Sensors;
  9. use App\Http\DBO\SensorsValueDbo;
  10. class DummySensor extends AbstractSensor
  11. {
  12. /**
  13. * @return SensorsValueDbo
  14. */
  15. public function getValue()
  16. {
  17. $data = $this->_sensor->getData();
  18. $min = isset($data["Minimum"]) ? $data["Minimum"] : 0;
  19. $max = isset($data["Maximum"]) ? $data["Maximum"] : 42;
  20. $value = new SensorsValueDbo();
  21. $value->setValue(rand($min, $max));
  22. return $value;
  23. }
  24. }