Homey Community Forum

Docs and Typescript out of sync for AthomCloudAPI and HomeyApi

Hi,
I have created an Issue in Github related to Docs and Typescript definitions being out of sync with the actual implementation of AthomCloudApi and HomeyApi; https://github.com/athombv/homey-web-api-issues/issues/9.

Now, one thing is that this gives ugly errors in my IDE, but it also make consumption of these APIs as a nightmare and requires a lot trying, failing and guessing. It doesnt help that no source map is includes in the NPM package and that your only option is looking at minified JS code. What did I do wrong to you?

Any chance Athom devs can help other fellow devs to make our dev life easier?

My experience is that third-party devs should regard Athom’s libraries are a black box. A fair amount of devs don’t have extensive JS development experience, and don’t miss source maps because they don’t use debuggers or want to decipher stack traces.

@robertklep I can agree on your point regarding need for source maps, but I can´t agree on your comment regarding how devs should look at Athoms libraries.

When a vendor exposes APIs to rest of the world they do this for a reason: they want their products and services to be used. In order to use an API as developer you typically need following basic information about its interface:

  • Short description of the service
  • How to call the service and what you can expect in return (request/response/protocol)
  • Which errors you can expect

To describe the interfaces, vendors can use one or more of following options:

  1. Typescript definitions
  2. Document APIs in Swagger (machine readable format)
  3. Document APIs manually
  4. Provide client library

Athom has chosen 1, 3 and 4, which is great. The issue is that these are not aligned with the current implementation of services (probably because of manual maintenance). This leads to confusion and requires a lot trying and failing from developers.

I would also argue that Athom APIs DO require some technical JS skills, and even more if the APIs are not correctly described with options mentioned above

Just to be clear: I didn’t express my opinion with that comment, but what I feel Athom’s opinion is regarding their libraries.

1 Like

Dear Athom core team: could you please comment on this topic? It is really hard to understand how to use the HomeyAPI currently as documentation and library is out of sync and it lacks description of the methods. Thanks in advance!

Athom doesn’t officially read this forum. If they also don’t respond to your support requests, there’s nothing much that you can do I’m afraid.

Hmm… I was going to create a support request, but I gave up when I was asked for Homey Diagnostics Report ID. Seems like that is ment to be used for Homey only. However, in Slack channel Developers they link to https://github.com/athombv/homey-web-api-issues/issues which I have already created an issue…