Skip to content

Conversation

@ElectroAttacks
Copy link

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:

  • Audio model: Made volume, volume_limit, volume_range optional to support Sky devices without audio capabilities
  • Bluetooth model: Made all fields optional with defaults to handle devices with limited/no Bluetooth functionality
  • Documentation: Updated docstrings to use "LaMetric device" instead of "LaMetric Time" for inclusivity

These 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 widgets
  • Widget - Represents app widget instances with settings
  • LaMetricUnsupportedError - Exception for API version incompatibility (404 responses)

New Methods

  • apps() - Get all installed applications
  • app(package) - Get specific app details
  • widget(package, widget_id) - Get widget details
  • app_activate(package, widget_id) - Activate specific app widget
  • widget_action(...) - Trigger widget actions (e.g., change clock faces)
  • widget_update(...) - Update widget settings

Error Handling Strategy

  • Read operations return None for unsupported devices (graceful degradation)
  • Write operations raise LaMetricUnsupportedError for unsupported devices (explicit failure)
  • Ensures backward compatibility with firmware versions < v2.1.0

Device Compatibility

Device Status Notes
LaMetric Sky ✅ Supported Optional Audio/Bluetooth fields
LaMetric TIME ✅ Supported All features available
Older firmware ✅ Compatible Graceful degradation for Apps API

Related Issues

home-assistant/core#133815
home-assistant/core#157046

@helgek
Copy link

helgek commented Jan 6, 2026

@ElectroAttacks thank you so much!! I'm looking forward to test this fix once it has been approved and integrated!

@ElectroAttacks
Copy link
Author

@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

@helgek
Copy link

helgek commented Jan 7, 2026

@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.
Maybe you have seen already this extended integration https://github.com/spyfly/ha-lametric-sky which has been available for a long time already but due to the broken main integration (at least for SKY) it was also not usable anymore.

@ElectroAttacks
Copy link
Author

@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. Maybe you have seen already this extended integration https://github.com/spyfly/ha-lametric-sky which has been available for a long time already but due to the broken main integration (at least for SKY) it was also not usable anymore.

@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...
Why should the API return a volume field on a device where audio isn't available at all, right?

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.

@helgek
Copy link

helgek commented Jan 8, 2026

@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:

sky_pwa_bundle.zip

@ElectroAttacks
Copy link
Author

@frenck Did you take a look yet? Hope you approve of my changes, but definitely looking forward to your input.

@ElectroAttacks
Copy link
Author

@helgek Thanks for that input, I started working on a Desktop application now, haha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants