Add LaMetric Apps API support and fix LaMetric Sky compatibility#1076
Add LaMetric Apps API support and fix LaMetric Sky compatibility#1076ElectroAttacks wants to merge 6 commits intofrenck:mainfrom
Conversation
|
@ElectroAttacks thank you so much!! I'm looking forward to test this fix once it has been approved and integrated! |
@helgek You're welcome! After approval, I will extend the Integration as well... Might take a while to be honest though |
|
@ElectroAttacks I'm more than happy already that there's a chance to add my SKY installation to HA anytime soon, it's such a great and unique solution and integrates so well into my living room setup. |
@helgek Yes, I've seen that try to fix the integration... But that was more like a work- around for earlier API versions... I think the reason why the integration fails since then is that lametric changed their API so it will only return fields that make sense... That's why I've read the API docs, and implemented the missing features within this PR, except of the streaming API.... I think at some point you could add that as well, but the implementation of it is a bit more complicated. |
|
@ElectroAttacks Yes, that's also what I understood, that the api was changed on the SKY side to not provide the sound interface anymore, which indeed didn't make sense. Of course a direct integration a the SKY specific features is much better instead of a workaround running on top of the native integration. I'm really looking forward to try out the changes you submitted. When you pointed to the streaming api I thought I would give ai a chance to build a web based tool to use the api to broadcast to SKY. The outcome attached didn't work for me (yet), but I thought it's maybe interesting/entertaining enough to be shared: |
|
@frenck Did you take a look yet? Hope you approve of my changes, but definitely looking forward to your input. |
|
@helgek Thanks for that input, I started working on a Desktop application now, haha |
|
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. Thank you for your contributions. |
|
Still due for review by @frenck |
Proposed Changes
This PR adds comprehensive support for the LaMetric Apps API (available since API v2.1.0) and fixes compatibility issues with LaMetric Sky devices.
🎉 LaMetric Sky Device Support
LaMetric Sky devices were experiencing deserialization errors due to missing optional fields. This PR fixes those issues:
volume,volume_limit,volume_rangeoptional to support Sky devices without audio capabilitiesThese changes ensure the library works seamlessly with all LaMetric device models (TIME, Sky, etc.).
📱 Apps API Implementation
Implements the full LaMetric Apps API, enabling programmatic control of installed applications and widgets.
New Models
Application- Represents installed apps with actions, triggers, and widgetsWidget- Represents app widget instances with settingsLaMetricUnsupportedError- Exception for API version incompatibility (404 responses)New Methods
apps()- Get all installed applicationsapp(package)- Get specific app detailswidget(package, widget_id)- Get widget detailsapp_activate(package, widget_id)- Activate specific app widgetwidget_action(...)- Trigger widget actions (e.g., change clock faces)widget_update(...)- Update widget settingsError Handling Strategy
Nonefor unsupported devices (graceful degradation)LaMetricUnsupportedErrorfor unsupported devices (explicit failure)Device Compatibility
Related Issues