LordMike / MBW.BlueRiiot2MQTT

Utility to map between Blue Riiots pool API, and Home Assistant MQTT
49 stars 2 forks source link

New pools are null, for some time #9

Closed ggggh closed 4 years ago

ggggh commented 4 years ago

Really looking forward to getting this working! Thanks for your work on this!

Getting this on the logs at the moment though. (logs increased to debug). Getting state-status and state-attr on mqtt, but nothing else. (Removed actual body content)

[2020-06-09 ......+00:00 VRB] [MBW.Client.BlueRiiotApi.BlueClient] Received OK for https://api.riiotlabs.com/prod/swimming_pool?deleted=false, with body: {"data":[{"created":"........","user_id":".........","role":"FIRST_ADMINISTRATOR","name":".....","swimming_pool_id":".........."}]}

[2020-06-09 ......+00:00 ERR] [MBW.BlueRiiot2MQTT.Service.BlueRiiotMqttService] An error occurred while performing the update
System.NullReferenceException: Object reference not set to an instance of an object.
   at MBW.BlueRiiot2MQTT.Service.BlueRiiotMqttService.PerformUpdate(CancellationToken stoppingToken) in /src/MBW.BlueRiiot2MQTT/Service/BlueRiiotMqttService.cs:line 99
   at MBW.BlueRiiot2MQTT.Service.BlueRiiotMqttService.ExecuteAsync(CancellationToken stoppingToken) in /src/MBW.BlueRiiot2MQTT/Service/BlueRiiotMqttService.cs:line 60
ggggh commented 4 years ago

Hmm...just started working now! That same HTTP response has many more values now. Closing issue!

LordMike commented 4 years ago

I see.. At that point in the code, I'm expecting the pool to be filled out..

So what happens is I get a list of "user pools", which are placeholder objects between a user and a pool ... and there I expected the pool to be filled out.

You got an error indicating the pool was null / not filled out.

I'm guessing the pool was very new?

ggggh commented 4 years ago

Yes! Thanks!

LordMike commented 4 years ago

Ah.. Might consider handling that.

LordMike commented 4 years ago

Maybe it's null until some first configuration / measurements arrive.