Repository navigation
Add get_configuration/set_configuration for device settings - #16
Open
gabrielmazor wants to merge 3 commits into
Open
gabrielmazor wants to merge 3 commits into
gabrielmazor wants to merge 3 commits into
Conversation
Owner
|
Hi Gabriel, thank you very much for the contribution. I will be able to test it against my own device this weekend then I'll accept the PR. |
gabrielmazor
force-pushed
the
feat/device-configuration
branch
from
September 2, 2026 06:24
4b3c651 to
5c672f8
Compare
Exposes the device configuration endpoint (lighting, child lock, etc.) so downstream integrations like Home Assistant can read and toggle these settings. Partial POSTs merge server-side; changes propagate to reads after a few seconds.
Disabling connectivity may take the device off the cloud, which is the only channel able to turn it back on. set_configuration now raises UnsafeConfigurationException rather than sending it. Reads are unaffected and still return the property.
gabrielmazor
force-pushed
the
feat/device-configuration
branch
from
September 2, 2026 13:57
5c672f8 to
574fd82
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #6.
Adds
get_configuration()andset_configuration()toTami4EdgeAPI.py, wrapping the/api/v3/device/{id}/configurationendpoint (verified against a real device, firmware 4.1.29):get_configuration()returns theconfigurationPropertiesdict as-is (no dataclass — firmware versions expose different key sets, so a fixed schema would raiseKeyErroron bars with fewer keys).set_configuration(**properties)POSTs only the given properties; partial payloads merge server-side, so no read-modify-write is needed.set_configuration()refuses to writeconnectivityEnabled, raisingUnsafeConfigurationException. Disabling it may take the device off the cloud, which is the only channel able to turn it back on. Reads are unaffected.get_configuration()for a few seconds after the POST — a read issued immediately after a write will still show the old value.Bumped
versionto3.1insetup.pyand documented the new methods in the README.I've also built a Home Assistant
switchplatform on top of this, exposing the LED lighting plus six other device settings, which I'd like to upstream tohome-assistant/core. I've been running it against my own bar and it works well. That PR is blocked onTami4EdgeAPI==3.1being on PyPI, sincemanifest.jsonpins exact versions and your publish workflow runs on release — would you be able to cut a3.1release once this looks good to you? Happy to make any changes you'd like first.