Danielhiversen / home_assistant_airthings_cloud

Airthings cloud
Apache License 2.0
32 stars 6 forks source link

Updating mapping for new multi dashboard #27

Closed gregology closed 3 years ago

gregology commented 3 years ago

URL and mappings have changed for the Dashboard.

New URL is https://web-api.airthin.gs/v1/dashboards note the additional s image

The returned JSON has also changed and requires an additional nesting within currentDashboard

{
  "dashboards":[
    {
      "name":"Personal",
      "id":"foo",
      "visibility":"user"
    }
  ],
  "currentDashboard":{
    "name":"Personal",
    "id":"bar",
    "visibility":"user",
    "tiles":[
      {
        "id":"baz",
        "type":"device",
        "width":1,
        "ref":"quz",
        "content":{
          "serialNumber":"quz",
          "locationName":"Home",
          "roomName":"Living Room",
          "segmentStart":"2020-12-02T03:26:05",
          "latestSample":"2021-06-18T02:27:26",
          "currentSensorValues":[
            {
              "type":"radonShortTermAvg",
              "value":175.0,
              "providedUnit":"bq",
              "preferredUnit":"bq",
              "isAlert":true,
              "thresholds":[
                100,
                150
              ]
            },

I have this branch working on my Home Assistant

image

Addresses issue https://github.com/Danielhiversen/home_assistant_airthings_cloud/issues/26

gregology commented 3 years ago

@Danielhiversen, for your consideration mate