Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added settings retrieval and toggling of motion detection #10

Merged
merged 2 commits into from
Sep 20, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions fullykiosk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def __init__(self, session, host, port, password):
self._rh = _RequestsHandler(session, host, port)
self._password = password
self._deviceInfo = None
self._settings = None

async def sendCommand(self, cmd, **kwargs):
data = await self._rh.get(
Expand All @@ -30,10 +31,18 @@ async def getDeviceInfo(self):
self._deviceInfo = result
return self._deviceInfo

async def getSettings(self):
result = await self.sendCommand("listSettings")
self._settings = result
return self._settings

@property
def deviceInfo(self):
return self._deviceInfo

def settings(self):
cgarwood marked this conversation as resolved.
Show resolved Hide resolved
return self._settings

async def startScreensaver(self):
await self.sendCommand("startScreensaver")

Expand Down Expand Up @@ -93,6 +102,12 @@ async def lockKiosk(self):
async def unlockKiosk(self):
await self.sendCommand("unlockKiosk")

async def enableMotionDetection(self):
await self.setConfigurationBool("motionDetection", True)

async def disableMotionDetection(self):
await self.setConfigurationBool("motionDetection", False)

async def rebootDevice(self):
await self.sendCommand("rebootDevice")

Expand Down