rmceoin / cominghome

Coming Home sets away/home with Nest Thermostats on Android
Apache License 2.0
2 stars 1 forks source link

backend: better handling when no thermostats associated with structure_id #9

Open rmceoin opened 9 years ago

rmceoin commented 9 years ago

Better handle when there is no thermostats in the Nest response in getNestAwayStatusCall.

{  
   "CbQzPlOmBO0UsYH7OPwEbM_HfQxOjVPHyhVq6IlUdx_uS9z4_RA":{  
      "name":"Work",
      "away":"unknown",
      "structure_id":"CbQzPlOmBO0UsYH7OPwEbM_HfQxOjVPHyhVq6IlUdx_uS9z4_RA"
   },
   "s_cWZj1rcXdRBjEolEtnmnnchQVVg8NPRicW53q2z123WmdEF0w":{  
      "name":"Home",
      "country_code":"US",
      "time_zone":"America/New_York",
      "away":"home",
      "thermostats":[  
         "AeHRF8xA9PnT7EREQLVoZTWQG0s2y"
      ],
      "structure_id":"s_cWZj1rcXdRBjEolEtnmnnchQVVg8NPRicW53q2z123WmdEF0w"
   }
}