kiosker-python-api 1.2.2__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.
- kiosker_python_api-1.2.4/.github/workflows/python-publish.yml +70 -0
- {kiosker_python_api-1.2.2 → kiosker_python_api-1.2.4}/PKG-INFO +17 -5
- {kiosker_python_api-1.2.2 → kiosker_python_api-1.2.4}/README.md +16 -4
- {kiosker_python_api-1.2.2 → kiosker_python_api-1.2.4}/kiosker/data.py +3 -2
- {kiosker_python_api-1.2.2 → kiosker_python_api-1.2.4}/pyproject.toml +1 -1
- {kiosker_python_api-1.2.2 → kiosker_python_api-1.2.4}/tests/test_api.py +2 -1
- {kiosker_python_api-1.2.2 → kiosker_python_api-1.2.4}/.gitignore +0 -0
- {kiosker_python_api-1.2.2 → kiosker_python_api-1.2.4}/LICENSE +0 -0
- {kiosker_python_api-1.2.2 → kiosker_python_api-1.2.4}/kiosker/__init__.py +0 -0
- {kiosker_python_api-1.2.2 → kiosker_python_api-1.2.4}/kiosker/api.py +0 -0
- {kiosker_python_api-1.2.2 → kiosker_python_api-1.2.4}/tests/__init__.py +0 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# This workflow will upload a Python Package to PyPI when a release is created
|
|
2
|
+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
|
|
3
|
+
|
|
4
|
+
# This workflow uses actions that are not certified by GitHub.
|
|
5
|
+
# They are provided by a third-party and are governed by
|
|
6
|
+
# separate terms of service, privacy policy, and support
|
|
7
|
+
# documentation.
|
|
8
|
+
|
|
9
|
+
name: Upload Python Package
|
|
10
|
+
|
|
11
|
+
on:
|
|
12
|
+
release:
|
|
13
|
+
types: [published]
|
|
14
|
+
|
|
15
|
+
permissions:
|
|
16
|
+
contents: read
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
release-build:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/checkout@v4
|
|
24
|
+
|
|
25
|
+
- uses: actions/setup-python@v5
|
|
26
|
+
with:
|
|
27
|
+
python-version: "3.x"
|
|
28
|
+
|
|
29
|
+
- name: Build release distributions
|
|
30
|
+
run: |
|
|
31
|
+
# NOTE: put your own distribution build steps here.
|
|
32
|
+
python -m pip install build
|
|
33
|
+
python -m build
|
|
34
|
+
|
|
35
|
+
- name: Upload distributions
|
|
36
|
+
uses: actions/upload-artifact@v4
|
|
37
|
+
with:
|
|
38
|
+
name: release-dists
|
|
39
|
+
path: dist/
|
|
40
|
+
|
|
41
|
+
pypi-publish:
|
|
42
|
+
runs-on: ubuntu-latest
|
|
43
|
+
needs:
|
|
44
|
+
- release-build
|
|
45
|
+
permissions:
|
|
46
|
+
# IMPORTANT: this permission is mandatory for trusted publishing
|
|
47
|
+
id-token: write
|
|
48
|
+
|
|
49
|
+
# Dedicated environments with protections for publishing are strongly recommended.
|
|
50
|
+
# For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
|
|
51
|
+
environment:
|
|
52
|
+
name: pypi
|
|
53
|
+
# OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
|
|
54
|
+
# url: https://pypi.org/p/YOURPROJECT
|
|
55
|
+
#
|
|
56
|
+
# ALTERNATIVE: if your GitHub Release name is the PyPI project version string
|
|
57
|
+
# ALTERNATIVE: exactly, uncomment the following line instead:
|
|
58
|
+
# url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }}
|
|
59
|
+
|
|
60
|
+
steps:
|
|
61
|
+
- name: Retrieve release distributions
|
|
62
|
+
uses: actions/download-artifact@v4
|
|
63
|
+
with:
|
|
64
|
+
name: release-dists
|
|
65
|
+
path: dist/
|
|
66
|
+
|
|
67
|
+
- name: Publish release distributions to PyPI
|
|
68
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
69
|
+
with:
|
|
70
|
+
packages-dir: dist/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kiosker-python-api
|
|
3
|
-
Version: 1.2.
|
|
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
|
|
@@ -23,7 +23,7 @@ Python wrapper for Kiosker API-integration.
|
|
|
23
23
|
### Installation
|
|
24
24
|
|
|
25
25
|
```shell
|
|
26
|
-
|
|
26
|
+
pip install kiosker-python-api
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
---
|
|
@@ -31,7 +31,12 @@ pip3 install kiosker-python
|
|
|
31
31
|
### Setup
|
|
32
32
|
|
|
33
33
|
```python
|
|
34
|
-
|
|
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
|
|
151
|
+
from kiosker import Blackout
|
|
145
152
|
|
|
146
153
|
blackout = Blackout(
|
|
147
154
|
visible=True, # Required: show blackout screen
|
|
@@ -250,7 +257,7 @@ HOST="0.0.0.0" TOKEN="" pytest -s
|
|
|
250
257
|
|
|
251
258
|
6. Build the library
|
|
252
259
|
```shell
|
|
253
|
-
python -m build
|
|
260
|
+
python -m build
|
|
254
261
|
```
|
|
255
262
|
|
|
256
263
|
7. Upload to test
|
|
@@ -258,6 +265,11 @@ python -m build --wheel
|
|
|
258
265
|
twine upload --repository testpypi dist/*
|
|
259
266
|
```
|
|
260
267
|
|
|
268
|
+
7. Upload to prod
|
|
269
|
+
```shell
|
|
270
|
+
twine upload dist/*
|
|
271
|
+
```
|
|
272
|
+
|
|
261
273
|
---
|
|
262
274
|
|
|
263
275
|
### API Documentation
|
|
@@ -6,7 +6,7 @@ Python wrapper for Kiosker API-integration.
|
|
|
6
6
|
### Installation
|
|
7
7
|
|
|
8
8
|
```shell
|
|
9
|
-
|
|
9
|
+
pip install kiosker-python-api
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
---
|
|
@@ -14,7 +14,12 @@ pip3 install kiosker-python
|
|
|
14
14
|
### Setup
|
|
15
15
|
|
|
16
16
|
```python
|
|
17
|
-
|
|
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
|
|
134
|
+
from kiosker import Blackout
|
|
128
135
|
|
|
129
136
|
blackout = Blackout(
|
|
130
137
|
visible=True, # Required: show blackout screen
|
|
@@ -233,7 +240,7 @@ HOST="0.0.0.0" TOKEN="" pytest -s
|
|
|
233
240
|
|
|
234
241
|
6. Build the library
|
|
235
242
|
```shell
|
|
236
|
-
python -m build
|
|
243
|
+
python -m build
|
|
237
244
|
```
|
|
238
245
|
|
|
239
246
|
7. Upload to test
|
|
@@ -241,6 +248,11 @@ python -m build --wheel
|
|
|
241
248
|
twine upload --repository testpypi dist/*
|
|
242
249
|
```
|
|
243
250
|
|
|
251
|
+
7. Upload to prod
|
|
252
|
+
```shell
|
|
253
|
+
twine upload dist/*
|
|
254
|
+
```
|
|
255
|
+
|
|
244
256
|
---
|
|
245
257
|
|
|
246
258
|
### API Documentation
|
|
@@ -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']
|
|
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.
|
|
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'
|
|
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
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|