Guest User

Untitled

a guest
Oct 23rd, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. defmod g.printer.3d.anycubic.i3mega.octoprint OctoPrint [ip-der-octoprint-installation] [port-der-octoprint-installation]
  2. attr g.printer.3d.anycubic.i3mega.octoprint alias Anycubic i3 Mega
  3. attr g.printer.3d.anycubic.i3mega.octoprint apikey xxxxx
  4. attr g.printer.3d.anycubic.i3mega.octoprint group Netzwerkdrucker
  5. attr g.printer.3d.anycubic.i3mega.octoprint icon 3d-printer@black
  6. attr g.printer.3d.anycubic.i3mega.octoprint plugin_psucontrol 1
  7. attr g.printer.3d.anycubic.i3mega.octoprint room Allgemein
  8. attr g.printer.3d.anycubic.i3mega.octoprint stateFormat {\
  9. use POSIX qw(strftime);;\
  10. my $state = ReadingsVal("$name", "state", '');;\
  11. \
  12. return "Kein aktiver Druckvorgang" if ($state ne "Printing");;\
  13. \
  14. return sprintf(\
  15. "Drucke Objekt <strong>%s</strong>, abgeschlossen am <strong>%s</strong>",\
  16. ReadingsVal("$name", "job_name", "unbekannt"),\
  17. strftime('%A, den %d.%m.%Y, um %X', localtime ReadingsVal("$name", "job_endtime", 0))\
  18. ) if ($state eq "Printing")\
  19. }
  20. attr g.printer.3d.anycubic.i3mega.octoprint userReadings \
  21. job_name {\
  22. use File::Basename;;\
  23. return basename(ReadingsVal("$name", "job_file_display", ""), ".gcode");;\
  24. },\
  25. job_endtime {\
  26. my $now = time();;\
  27. my $duration = ReadingsVal("$name", "progress_printTimeLeft", 0);;\
  28. my $end = $now + $duration;;\
  29. },
Add Comment
Please, Sign In to add comment