Giter Club home page Giter Club logo

netatmo-swagger-decl's Introduction

Netatmo OpenAPI Specification

Build Status swagger

Swagger declaration file for the Netatmo API

Described APIs are :

  • Weather station
  • Thermostat
  • Cameras (Welcome and Presence)
  • Enterprise

Links

Warning: All above links are updated only after Travis CI finishes deployment

Working on specification

Install

  1. Install Node JS
  2. Clone repo and cd
    • Run npm install

Usage

The spec is located in the spec directory. You can edit it manually or using a synchronized swagger-editor

  1. Run npm start
  2. Checkout console output to see where local server is started. You can use all links (except preview) by replacing https://cbornet.github.io/netatmo-swagger-decl/ with url from the message: Server started <url>
  3. Make changes in the file spec/swagger.yaml using your favorite editor or in swagger-editor (look for URL in console output)
  4. All changes are immediately propagated to your local server, moreover all documentation pages will be automagically refreshed in a browser after each change TIP: you can open swagger-editor, documentation and swagger-ui in parallel
  5. Once you finish with the changes you can run tests using: npm test

Thanks to contributors:

netatmo-swagger-decl's People

Contributors

cbornet avatar clinique avatar crazyphil avatar novanic avatar sstrohschein avatar wep4you avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

netatmo-swagger-decl's Issues

Use allOf when possible

For the moment, swagger-codegen has some issues with allOf in java generator. When it is fixed, this can be done (see refactor branch)

Support for getting favorite stations

The official documentation of /getstationsdata mentions the get_favorites parameter to add favorited stations from the public Weathermap to the list of stations. This would allow querying data from stations not directly associated to the user's account.

Could you please add support for this parameter to the specification? Unfortunately, it is not clear to me whether setting the parameter to true will only return favorited stations or add them to own ones, and I don't have any devices to test this with.

program_id definition seems incorrect

Hello,
I am using OpenHAB2, which makes use of you swagger definition, with a Netatmo Thermostat but it fails with the following error :

17:34:20.527` [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'netatmo:NAPlug:2a0453b1' changed from ONLINE to OFFLINE: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 1880 path $.body.devices[0].therm_program..program_id

Digging a little bit (actually, took me ages to figure it out and some discussion with @clinique ...)

Netatmo API returns the following :

"therm_program": {
          "xx:xx:xx:xx:xx:xx": {
            "zones": [
           ... 
           ],
            "timetable": [
          ...
            ],
            "program_id": {
              "$id": "aaaaaaa"
            },
            "name": "Standard"
          }

Changing program_id definition in swagger file from

                 "program_id": {
                    "type": "string"
                 }, 

to

                 "program_id": {
                    "type": "object",
                    "additionalProperties": {
                        "$id": {
                            "type": "string"
                        }
                    }
                 }, 

seems to solve my problem !

I made the changes here : https://github.com/jsiobj/netatmo-swagger-decl/blob/therm_prog_id/swagger.json

But I am not used to Git and as you just made some modifications, can I push a PR directly ?

Thanks.
JS

Switch to Getthermostatsdata, Gethomedata and Getstationsdata by November 30th

I got this info today:

Friendly reminder: Getthermstate, Getuser and Devicelist will move from deprecated to shut down. On November 30th, we are proceeding to a structural change to make our APIs faster and more powerful. Unfortunately, old and deprecated API methods won’t be supported anymore. Make sure you amend your code and start using newer methods as soon as possible for a smooth transition:

Replace Getthermstate with Getthermostatdata
Replace Getuser with Getthermostatdata, Gethomedata or Getstationsdata
Replace Devicelist with Getthermostatdata or Getstationsdata

So it looks like, there are some updates required.

I already implemented the netatmo welcome

Change NAPlug.plug_connected_boiler field from boolean to int

As mentioned in #15, it seems that the NAPlug.plug_connected_boiler field needs to change from boolean to int, too.
I performed some tests on the Netatmo openhab2 binding and I kept getting conversion errors with gson upon thing creation (Netatmo API) until I changed it too.
Maybe @clinique can also confirm this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.