briis / hass-weatherflow

Home Assistant Integration for WeatherFlow Stations
MIT License
68 stars 11 forks source link

Unexpected error fetching weatherflow data: an integer is required (got type NoneType) #8

Closed Severinius-MUC closed 2 years ago

Severinius-MUC commented 2 years ago

After installation I got following error (v0.1.9): My Station ID 63146

Unexpected error fetching weatherflow data: an integer is required (got type NoneType) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 187, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 147, in _async_update_data return await self.update_method() File "/config/custom_components/weatherflow/init.py", line 104, in async_update_data data: ObservationDescription = await weatherflowapi.update_observations() File "/usr/local/lib/python3.9/site-packages/pyweatherflowrest/api.py", line 224, in update_observations lightning_strike_last_epoch=self.cnv.utc_from_timestamp( File "/usr/local/lib/python3.9/site-packages/pyweatherflowrest/helpers.py", line 101, in utc_from_timestamp return dt.datetime.utcfromtimestamp(timestamp).replace(tzinfo=UTC) TypeError: an integer is required (got type NoneType)

briis commented 2 years ago

Thank you. It seems that there is some inconsistency in what data is contained for different stations. In your case there is no last time of a Lightning Strike. It might be because the station is relatively new. I have now changed some things to ensure the program does not crash because of this. Will be out soon with a new update.

Severinius-MUC commented 2 years ago

Thank you for the fast reply…yes the station is pretty new. So waiting for the fix.

Thanks in advance

Severinius Am 5. Dez. 2021, 16:55 +0100 schrieb Bjarne Riis @.***>:

Thank you. It seems that there is some inconsistency in what data is contained for different stations. In your case there is no last time of a Lightning Strike. It might be because the station is relatively new. I have now changed some things to ensure the program does not crash because of this. Will be out soon with a new update. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

briis commented 2 years ago

You can test manually now if you want.

briis commented 2 years ago

I released 0.1.10 where this is contained. Reopen issue if it still not works.

Severinius-MUC commented 2 years ago

Thank you for the fix. Manually updated and now on latest HACS Version.

👍

Regards, Severinius Am 5. Dez. 2021, 18:31 +0100 schrieb Bjarne Riis @.***>:

Closed #8. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.