Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: can't compare datetime.datetime to datetime.date #2644

Closed
3 of 7 tasks
Salo79 opened this issue Sep 9, 2024 · 8 comments
Closed
3 of 7 tasks

[Bug]: can't compare datetime.datetime to datetime.date #2644

Salo79 opened this issue Sep 9, 2024 · 8 comments

Comments

@Salo79
Copy link

Salo79 commented Sep 9, 2024

I Have A Problem With:

The integration in general

What's Your Problem

When adding the integration in HA or after selecting the calendar (Abfalltermine Forchheim (abfalltermine_forchheim_de) and the associated parameters, the message
"The source returned an invalid response: "can't compare datetime.datetime to datetime.date"."
1
2

I would like to reinstall the integration because after updating the waste collection schedule no data is visible anymore.
All sensors have the status "unknown".

Source (if relevant)

No response

Logs

No response

Relevant Configuration

No response

Checklist Source Error

  • Use the example parameters for your source (often available in the documentation) (don't forget to restart Home Assistant after changing the configuration)
  • Checked that the website of your service provider is still working
  • Tested my attributes on the service provider website (if possible)
  • I have tested with the latest version of the integration (master) (for HACS in the 3 dot menu of the integration click on "Redownload" and choose master as version)

Checklist Sensor Error

  • Checked in the Home Assistant Calendar tab if the event names match the types names (if types argument is used)

Required

  • I have searched past (closed AND opened) issues to see if this bug has already been reported, and it hasn't been.
  • I understand that people give their precious time for free, and thus I've done my very best to make this problem as easy as possible to investigate.
@auhgit
Copy link

auhgit commented Sep 9, 2024

Same Problem here ...

Logger: custom_components.waste_collection_schedule.waste_collection_schedule.source_shell Quelle: custom_components/waste_collection_schedule/waste_collection_schedule/source_shell.py:147 Integration: Waste Collection Schedule ([Dokumentation](https://github.com/mampfes/hacs_waste_collection_schedule#readme)) Erstmals aufgetreten: 11:25:34 (1 Vorkommnisse) Zuletzt protokolliert: 11:25:34 fetch failed for source Zweckverband Abfallwirtschaft Region Hannover: Traceback (most recent call last): File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/source_shell.py", line 145, in fetch entries = self._source.fetch() ^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/source/aha_region_de.py", line 140, in fetch dates = self._ics.convert(r.text) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/service/ICS.py", line 48, in convert events: List[Any] = icalevents.events( ^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/icalevents/icalevents.py", line 57, in events found_events += parse_events( ^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/icalevents/icalparser.py", line 394, in parse_events elif e.end >= f and e.start <= t and is_not_exception(e.start): ^^^^^^^^^^ TypeError: can't compare datetime.datetime to datetime.date

@s-jetter
Copy link

s-jetter commented Sep 9, 2024

Same issue

  • as different providers (awb_es_de /aha_region_de ) are affected it seems to be related to python / ical parsing

Config:
waste_collection_schedule:
sources:
- name: awb_es_de
args:
city: Filderstadt
street: xxxxxxx

Done:

  • restart HA
  • reinstall via HACS and restart HA
  • checked data delivered by URL from awb_es_de.py

Error LOG:
This error originated from a custom integration.

Logger: custom_components.waste_collection_schedule.waste_collection_schedule.source_shell
Source: custom_components/waste_collection_schedule/waste_collection_schedule/source_shell.py:147
integration: Waste Collection Schedule (documentation)
First occurred: 15:27:38 (1 occurrences)
Last logged: 15:27:38

fetch failed for source Abfallwirtschaftsbetrieb Esslingen: Traceback (most recent call last): File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/source_shell.py", line 145, in fetch entries = self._source.fetch() ^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/source/awb_es_de.py", line 56, in fetch dates = self._ics.convert(r.text) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/service/ICS.py", line 48, in convert events: List[Any] = icalevents.events( ^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/icalevents/icalevents.py", line 57, in events found_events += parse_events( ^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/icalevents/icalparser.py", line 394, in parse_events elif e.end >= f and e.start <= t and is_not_exception(e.start): ^^^^^^^^^^ TypeError: can't compare datetime.datetime to datetime.date

@smsm1
Copy link

smsm1 commented Sep 9, 2024

I've got this issue too straight after the patch update to hone assistant, so I'm wondering if something has changed there?

@ZapodD
Copy link

ZapodD commented Sep 9, 2024

Same issue here. Fresh HA (and HACS) installation.

@scm35768
Copy link

scm35768 commented Sep 9, 2024

Same issue here

@jack5288
Copy link

jack5288 commented Sep 9, 2024

Same issue here
after Patch HA to 2024.9.1

fetch failed for source Landkreis Erlangen-Höchstadt: Traceback (most recent call last): File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/source_shell.py", line 145, in fetch entries = self._source.fetch() ^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/source/erlangen_hoechstadt_de.py", line 25, in fetch dates = self.fetch_year(today.year) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/source/erlangen_hoechstadt_de.py", line 45, in fetch_year return self._ics.convert(r.text) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/service/ICS.py", line 48, in convert events: List[Any] = icalevents.events( ^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/icalevents/icalevents.py", line 57, in events found_events += parse_events( ^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/icalevents/icalparser.py", line 394, in parse_events elif e.end >= f and e.start <= t and is_not_exception(e.start): ^^^^^^^^^^ TypeError: can't compare datetime.datetime to datetime.date

@dm82m
Copy link
Contributor

dm82m commented Sep 9, 2024

This issue is a duplicate, there is already one: #2643

@Salo79 Salo79 closed this as completed Sep 9, 2024
@Salo79
Copy link
Author

Salo79 commented Sep 9, 2024

After restoring to backup with old HACS version and then updating HACS again, the issue no longer occurred.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants