Ngenic Tune Python API Wrapper
This python package simplifies access to the Ngenic Tune API. It can be used for viewing or edit your Tune configuration.
Both sync and async APIs are provided - async APIs are prefixed with async_.
NOTE: This API wrapper is not yet finished, and only implements a subset of all the APIs. The interface may very well change.
Prerequisite
Obtain an API token
An API token may be obtained here: https://developer.ngenic.se/
Installation
$ pip install ngenicpy
Example
import json
from ngenicpy import Ngenic
# try/finally
try:
ngenic = Ngenic(token="YOUR-API-TOKEN")
except NgenicException as e:
print(str(e))
finally:
ngenic.close()
# as context manager
with Ngenic(token="YOUR-API-TOKEN") as ngenic:
tunes = ngenic.tunes()
for tune in tunes:
print("Tune %s\nName: %s\nTune Name: %s" %
(
tune.uuid(),
tune["name"],
tune["tuneName"]
)
)
tune = ngenic.tune("TUNE-UUID")
rooms = tune.rooms()
for room in rooms:
print("Room %s\nName: %s\nTarget Temperature: %d" %
(
room.uuid(),
room["name"],
room["targetTemperature"]
)
)
# Update a room
room = tune.room(room_uuid="ROOM-UUID")
room["name"] = "Livingroom"
room.update()
nodes = tune.nodes()
for node in nodes:
node_status = node.status()
print("Node %s\nType: %s" %
(
node.uuid(),
node.get_type()
)
)
if node_status:
print("Battery: %s\nRadio Signal: %s" %
(
str(node_status.battery_percentage()),
str(node_status.radio_signal_percentage())
)
)
measurements = node.measurements()
for measurement in measurements:
print("%s: %d" %
(
measurement.get_type(),
measurement["value"]
)
)
Async example
import json
from ngenicpy import Ngenic
async with AsyncNgenic(token="YOUR-API-TOKEN") as ngenic:
tunes = await ngenic.async_tunes()
for tune in tunes:
print("Tune %s\nName: %s\nTune Name: %s" %
(
tune.uuid(),
tune["name"],
tune["tuneName"]
)
)
Reference
Metadata
Release files for ngenicpy 0.5.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ngenicpy-0.5.2.tar.gz | 10.1 kB | With provenance | Details for ngenicpy-0.5.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ngenicpy-0.5.2-py3-none-any.whl | Python 3 | none | any | Details for ngenicpy-0.5.2-py3-none-any.whl |
Total release size: 25.1 kB
Release files / ngenicpy-0.5.2.tar.gz
| Download URL | ngenicpy-0.5.2.tar.gz |
|---|---|
| Size | 10.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0e6cf8e016d3ebacebdb54e8bbfe48a670fd8f628046e0a909076df62d575b77
|
|
BLAKE2b-256 checksum How to use checksums |
07ecf44efc376a31ddc4dc01a49cdb5aa5109709564d928a5860de8da770f357
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 27, 2025.
Transparency logRelease files / ngenicpy-0.5.2-py3-none-any.whl
| Download URL | ngenicpy-0.5.2-py3-none-any.whl |
|---|---|
| Size | 14.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8af8925489eb3371a2122ecfa4ca8a1a9087f8a79f31a9efd5e8800a6f4f18f0
|
|
BLAKE2b-256 checksum How to use checksums |
0fac115e7be0ad203afa5d9a8a7e78782ed1c34b611c09d34560db5abe20c45d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 27, 2025.
Transparency logSecurity for ngenicpy 0.5.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for ngenicpy-0.5.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 27, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.