kiosker-python-api 1.2.3__tar.gz → 1.2.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kiosker-python-api
3
- Version: 1.2.3
3
+ Version: 1.2.4
4
4
  Summary: A python wrapper for the Kiosker API
5
5
  Project-URL: Homepage, https://kiosker.io
6
6
  Project-URL: Documentation, https://docs.kiosker.io
@@ -31,7 +31,12 @@ pip install kiosker-python-api
31
31
  ### Setup
32
32
 
33
33
  ```python
34
- from kiosker.api import KioskerAPI
34
+ KioskerAPI(host, token, port = 8081, ssl = False)
35
+ ```
36
+
37
+ ```python
38
+ from kiosker import KioskerAPI
39
+ from kiosker import Status, Result, Blackout, ScreensaverState
35
40
  api = KioskerAPI('10.0.1.100', 'token')
36
41
  ```
37
42
 
@@ -51,6 +56,8 @@ print(f'Battery level: {status.battery_level}%')
51
56
  print(f'Battery state: {status.battery_state}')
52
57
  print(f'Last interaction: {status.last_interaction}')
53
58
  print(f'Last motion: {status.last_motion}')
59
+ print(f'App name: {status.app_name}')
60
+ print(f'App version: {status.app_version}')
54
61
  print(f'Last status update: {status.last_update}')
55
62
  ```
56
63
  **Description**: Retrieves the current status of the kiosk.
@@ -141,7 +148,7 @@ print(f"Screensaver state: {state}")
141
148
 
142
149
  #### Set Blackout
143
150
  ```python
144
- from kiosker.data import Blackout
151
+ from kiosker import Blackout
145
152
 
146
153
  blackout = Blackout(
147
154
  visible=True, # Required: show blackout screen
@@ -14,7 +14,12 @@ pip install kiosker-python-api
14
14
  ### Setup
15
15
 
16
16
  ```python
17
- from kiosker.api import KioskerAPI
17
+ KioskerAPI(host, token, port = 8081, ssl = False)
18
+ ```
19
+
20
+ ```python
21
+ from kiosker import KioskerAPI
22
+ from kiosker import Status, Result, Blackout, ScreensaverState
18
23
  api = KioskerAPI('10.0.1.100', 'token')
19
24
  ```
20
25
 
@@ -34,6 +39,8 @@ print(f'Battery level: {status.battery_level}%')
34
39
  print(f'Battery state: {status.battery_state}')
35
40
  print(f'Last interaction: {status.last_interaction}')
36
41
  print(f'Last motion: {status.last_motion}')
42
+ print(f'App name: {status.app_name}')
43
+ print(f'App version: {status.app_version}')
37
44
  print(f'Last status update: {status.last_update}')
38
45
  ```
39
46
  **Description**: Retrieves the current status of the kiosk.
@@ -124,7 +131,7 @@ print(f"Screensaver state: {state}")
124
131
 
125
132
  #### Set Blackout
126
133
  ```python
127
- from kiosker.data import Blackout
134
+ from kiosker import Blackout
128
135
 
129
136
  blackout = Blackout(
130
137
  visible=True, # Required: show blackout screen
@@ -8,15 +8,16 @@ class Status:
8
8
  battery_state: str
9
9
  model: str
10
10
  os_version: str
11
+ app_name: str
12
+ app_version: str
11
13
  last_interaction: datetime
12
14
  last_update: datetime
13
15
  device_id: str
14
16
  last_motion: Optional[datetime]
15
- screensaver_pause: Optional[bool]
16
17
 
17
18
  @classmethod
18
19
  def from_dict(cls, status_data):
19
- return cls(battery_level=status_data['batteryLevel'], battery_state=status_data['batteryState'], model=status_data['model'], os_version=status_data['osVersion'], last_interaction=datetime.fromisoformat(status_data['lastInteraction']), last_motion=datetime.fromisoformat(status_data['lastMotion']) if status_data.get('lastMotion') else None, last_update=datetime.fromisoformat(status_data['date']), device_id=status_data['deviceId'], screensaver_pause=status_data['screensaverPause'] if status_data.get('screensaverPause') else None)
20
+ return cls(battery_level=status_data['batteryLevel'], battery_state=status_data['batteryState'], model=status_data['model'], os_version=status_data['osVersion'], app_name=status_data['appName'], app_version=status_data['appVersion'], last_interaction=datetime.fromisoformat(status_data['lastInteraction']), last_motion=datetime.fromisoformat(status_data['lastMotion']) if status_data.get('lastMotion') else None, last_update=datetime.fromisoformat(status_data['date']), device_id=status_data['deviceId'])
20
21
 
21
22
  @dataclass
22
23
  class Result:
@@ -5,7 +5,7 @@ build-backend = "hatchling.build"
5
5
  [project]
6
6
  name = "kiosker-python-api"
7
7
  readme = "README.md"
8
- version = "1.2.3"
8
+ version = "1.2.4"
9
9
  license = "MIT"
10
10
  description = "A python wrapper for the Kiosker API"
11
11
  keywords = ["kiosk", "kiosker", "api", "kiosker pro"]
@@ -29,7 +29,8 @@ def test_status():
29
29
  print(f'Last interaction: {status.last_interaction}')
30
30
  print(f'Last motion: {status.last_motion}')
31
31
  print(f'Last status update: {status.last_update}')
32
- print(f'Screensaver pause: {status.screensaver_pause}')
32
+ print(f'App name: {status.app_name}')
33
+ print(f'App version: {status.app_version}')
33
34
 
34
35
  assert api.ping() == True
35
36