Bug or Feature? Missing fields in Websocket AIR summary object

@dsj Not sure if this is a bug or a feature, but when a new station comes online and no lightning strikes have yet been detected, two fields are missing from the AIR summary object: strike_last_dist and strike_last_epoch.

Station 690 with the fields:

{"status":{"status_code":0,"status_message":"SUCCESS"},"device_id":1110,"type":"obs_air","source":"cache",
"summary":{"pressure_trend":"falling","pressure_high_24h":1012.8,
"pressure_low_24h":1009.2,"strike_count_3h":60,"strike_last_dist":31,
"strike_last_epoch":1560103607},
"obs":[[1560104027,1011,33.2,99,0,0,2.38,1]]}

Station 7471 without the fields (as of yesterday)

{"status":{"status_code":0,"status_message":"SUCCESS"},"device_id":25238,"type":"obs_air","source":"cache",
"summary":{"pressure_trend":"steady","pressure_high_24h":1010.4,
"pressure_low_24h":1009.5,"strike_count_3h":0},"obs":[[1560114554,1010.1,14,74,0,0,3.25,1]]}

My instinct is that all the fields should be initialized, and just filled with null values if no data exists.

Hi Peter. It’s not really a bug or a feature, but just the way we chose to implement it: An explicit field (like strike_last_dist) that has no value will not appear in the message. The only place you’ll see null values is in the array elements.

2 Likes

OK, understood. I have updated the PiConsole accordingly, so this won’t be an issue any more :smiley: .

2 Likes