File tree Expand file tree Collapse file tree 3 files changed +20
-1
lines changed
Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,6 @@ public function getDevices(string $filter = null) {
8989 $ devices = [];
9090 foreach ($ receivedDevices as $ receivedDevice ) {
9191
92-
9392 switch ($ receivedDevice ->Type ) {
9493
9594 case 'Light/Switch ' :
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace rutgerkirkels \DomoticzPHP \Devices \Switches ;
4+
5+ /**
6+ * Class MotionSensor
7+ * @package rutgerkirkels\DomoticzPHP\Devices\Switches
8+ */
9+ class MotionSensor extends AbstractSwitch
10+ {
11+ public function getBatteryLevel () {
12+ return $ this ->batteryLevel ;
13+ }
14+
15+ }
Original file line number Diff line number Diff line change 44
55use rutgerkirkels \DomoticzPHP \Devices \Switches \Dimmer ;
66use rutgerkirkels \DomoticzPHP \Devices \Switches \DoorContact ;
7+ use rutgerkirkels \DomoticzPHP \Devices \Switches \MotionSensor ;
78use rutgerkirkels \DomoticzPHP \Devices \Switches \OnOff ;
89
910/**
@@ -30,6 +31,10 @@ public function __construct(object $deviceData)
3031 $ this ->data = new DoorContact ($ deviceData );
3132 break ;
3233
34+ case 'Motion Sensor ' :
35+ $ this ->data = new MotionSensor ($ deviceData );
36+ break ;
37+
3338 }
3439 }
3540
You can’t perform that action at this time.
0 commit comments