Skip to content

Commit 60704c9

Browse files
SamMousacgarwood
andauthored
Added settings retrieval and toggling of motion detection (#10)
* Added settings retrieval and toggling of motion detection * property decorator Co-authored-by: Charles Garwood <cgarwood@gmail.com>
1 parent 5f8c71b commit 60704c9

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

fullykiosk/__init__.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ def __init__(self, session, host, port, password):
1616
self._rh = _RequestsHandler(session, host, port)
1717
self._password = password
1818
self._deviceInfo = None
19+
self._settings = None
1920

2021
async def sendCommand(self, cmd, **kwargs):
2122
data = await self._rh.get(
@@ -30,10 +31,19 @@ async def getDeviceInfo(self):
3031
self._deviceInfo = result
3132
return self._deviceInfo
3233

34+
async def getSettings(self):
35+
result = await self.sendCommand("listSettings")
36+
self._settings = result
37+
return self._settings
38+
3339
@property
3440
def deviceInfo(self):
3541
return self._deviceInfo
3642

43+
@property
44+
def settings(self):
45+
return self._settings
46+
3747
async def startScreensaver(self):
3848
await self.sendCommand("startScreensaver")
3949

@@ -93,6 +103,12 @@ async def lockKiosk(self):
93103
async def unlockKiosk(self):
94104
await self.sendCommand("unlockKiosk")
95105

106+
async def enableMotionDetection(self):
107+
await self.setConfigurationBool("motionDetection", True)
108+
109+
async def disableMotionDetection(self):
110+
await self.setConfigurationBool("motionDetection", False)
111+
96112
async def rebootDevice(self):
97113
await self.sendCommand("rebootDevice")
98114

0 commit comments

Comments
 (0)