trash collection schedule

Python and python framework

Moderator: leecollings

Post Reply
erwub
Posts: 2
Joined: Sunday 15 May 2016 22:16
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

trash collection schedule

Post by erwub »

Hi all,

I made a Python script to scrape a ics file from a trash collection company and post it in domoticz as a text field. It scrapes the ics from inzamelschema.rmn.nl (which will only be usefull for a small group of Dutch people) and stores it on the SD card. If you mannually place a ics file it should not overwrite it but you risk having an outdated version.

So now the catchy part is. I made it on Windows in python3. And it works perfectly there. But if i run it on domoticz it will just give me this:
pi@domoticz:~/domoticz/scripts/python$ python3 afvalkalender.py
Traceback (most recent call last):
File "afvalkalender.py", line 171, in <module>
ics_result = read_ics('/var/tmp/inzamelschema.ics')
File "afvalkalender.py", line 91, in read_ics
icscal = Calendar.from_ical(ics.read())
File "/home/pi/.local/lib/python3.4/site-packages/icalendar/cal.py", line 401, in from_ical
'{st!r}'.format(**locals()))
ValueError: Found no components where exactly one is required: b''

I cant seem to google my way out of this so does anyone know what im doing wrong. I've added the script to it as a txt. Plz dont hate on it too much. My experience in pyhton is limited by being able to google it :D
Attachments
afvaldownloader.txt
(7.01 KiB) Downloaded 30 times
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest