Skip to content

Commit

Permalink
Add getCamshot (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
tronikos authored Jun 11, 2024
1 parent ec08261 commit ea197b7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions fullykiosk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ async def clearWebstorage(self):
async def clearCookies(self):
await self.sendCommand("clearCookies")

async def getCamshot(self):
return await self._rh.get(cmd="getCamshot", password=self._password)


class _RequestsHandler:
"""Internal class to create FullyKiosk requests"""
Expand Down Expand Up @@ -161,10 +164,10 @@ async def get(self, **kwargs):
)
raise FullyKioskError(response.status, await response.text())

try:
data = await response.json()
except aiohttp.client_exceptions.ContentTypeError:
data = await response.json(content_type="text/html")
content_type = response.headers['Content-Type']
if content_type.startswith("image/"):
return await response.content.read()
data = await response.json(content_type=content_type)

_LOGGER.debug(json.dumps(data))
return data

0 comments on commit ea197b7

Please sign in to comment.