Skip to content
This repository has been archived by the owner on Dec 18, 2021. It is now read-only.

can't compare datetime.datetime to datetime.date #68

Closed
verstrepeng opened this issue Apr 26, 2021 · 4 comments
Closed

can't compare datetime.datetime to datetime.date #68

verstrepeng opened this issue Apr 26, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@verstrepeng
Copy link

After upgrading via HACS to the latest version, my integration is broken.
In the logs following error:

Logger: custom_components.smartweather
Source: helpers/update_coordinator.py:143
Integration: WeatherFlow Smart Weather (documentation, issues)
First occurred: 15:27:54 (2 occurrences)
Last logged: 15:38:32

Unexpected error fetching smartweather data: can't compare datetime.datetime to datetime.date
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 173, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 143, in _async_update_data
    return await self.update_method()
  File "/usr/local/lib/python3.8/site-packages/pysmartweatherio/client.py", line 109, in get_hourly_forecast
    return await self._forecast_data(FORECAST_TYPE_HOURLY, 72)
  File "/usr/local/lib/python3.8/site-packages/pysmartweatherio/client.py", line 402, in _forecast_data
    if today > forecast_time:
TypeError: can't compare datetime.datetime to datetime.date
@briis briis added the bug Something isn't working label Apr 26, 2021
@briis
Copy link
Owner

briis commented Apr 26, 2021

I made a quick fix that should solve the problem:

Could you edit the file manifest.json in custom_components/smartweather and change this:

    "requirements": [
        "pysmartweatherio==2.1.8"
    ]

to this:

    "requirements": [
        "pysmartweatherio==2.1.9"
    ]

Restart Home Assistant, and see if it works?

briis added a commit that referenced this issue Apr 26, 2021
briis added a commit that referenced this issue Apr 26, 2021
@verstrepeng
Copy link
Author

You rock ! It is working again :-)

@alexdelprete
Copy link

Had the exact same issue, I just upgraded, and can confirm the fix works.

Thanks Bjarne.

@briis
Copy link
Owner

briis commented Apr 26, 2021

Perfect. I will release the fix to HACS now.

@briis briis closed this as completed Apr 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants