jneilliii / OctoPrint-PrintScheduler

MIT License
10 stars 2 forks source link

PrintScheduler invalid isoformat string while saving settings for plugin #24

Closed cristianilea-lateral closed 2 years ago

cristianilea-lateral commented 2 years ago

Hello!

I'm running on octoprint version 1.7.2.

I'm getting the following error:

2021-12-30 11:04:36,499 - octoprint.server.api.settings - ERROR - Could not save settings for plugin Print Scheduler (0.0.4)
Traceback (most recent call last):
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/server/api/settings.py", line 1114, in _saveSettings
    plugin.on_settings_save(data["plugins"][plugin_id])
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/util/__init__.py", line 1737, in wrapper
    return f(*args, **kwargs)
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_printscheduler/__init__.py", line 100, in on_settings_save
    data["scheduled_jobs"].sort(key=lambda item: datetime.fromisoformat(item.get("start_at")))
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_printscheduler/__init__.py", line 100, in <lambda>
    data["scheduled_jobs"].sort(key=lambda item: datetime.fromisoformat(item.get("start_at")))
ValueError: Invalid isoformat string: ''

Can you please give me some guidance on what to do?

For some context on what I'm trying to do: I'm trying to schedule a print job at a specific date & time and I want to power on the printer and i'm running a System Command Before Each Print: /home/pi/tplink_smartplug.py -t 192.168.1.13 -c on (which is a python script I've found online to turn on the tplink plug). Btw, i've seen that you're the same plugin author for the tplink plugin 😃. Is it possible to add some interoperability between the plugins?

How would you implement something like this? I'm concerned that the printer will start too slow, then it will need to "autoconnect" to octoprint and only then the print scheduler should start printing.

Thank you

jneilliii commented 2 years ago

Isoformat errors appear to think you didn't select a date and time in the print scheduler tab. Check the wiki link above for examples of tplink smartplug plugin integration...

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had activity in 14 days. It will be closed if no further activity occurs in 7 days