|
@@ -21,8 +21,8 @@ class PiFaceSensor extends AbstractSensor
|
21
|
21
|
|
22
|
22
|
$device = intval(isset($data['Device']) ? $data['Device'] : 0);
|
23
|
23
|
$pin = intval(isset($data['Pin']) ? $data['Pin'] : 0);
|
24
|
|
- $trueValue = intval(isset($data['True']) ? $data['True'] : 0);
|
25
|
|
- $falseValue = intval(isset($data['False']) ? $data['False'] : 0);
|
|
24
|
+ $trueValue = isset($data['True']) ? $data['True'] : 'Yes';
|
|
25
|
+ $falseValue = isset($data['False']) ? $data['False'] : 'No';
|
26
|
26
|
|
27
|
27
|
$args = [
|
28
|
28
|
'camotion-piface',
|
|
@@ -38,7 +38,12 @@ class PiFaceSensor extends AbstractSensor
|
38
|
38
|
}
|
39
|
39
|
|
40
|
40
|
$value = new SensorsValueDbo();
|
41
|
|
- $value->setValue($output);
|
|
41
|
+ if ($output[0] == "0") {
|
|
42
|
+ $value->setValue($falseValue);
|
|
43
|
+ }
|
|
44
|
+ else {
|
|
45
|
+ $value->setValue($trueValue);
|
|
46
|
+ }
|
42
|
47
|
return $value;
|
43
|
48
|
}
|
44
|
49
|
}
|