Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- defmod g.printer.3d.anycubic.i3mega.octoprint OctoPrint [ip-der-octoprint-installation] [port-der-octoprint-installation]
- attr g.printer.3d.anycubic.i3mega.octoprint alias Anycubic i3 Mega
- attr g.printer.3d.anycubic.i3mega.octoprint apikey xxxxx
- attr g.printer.3d.anycubic.i3mega.octoprint group Netzwerkdrucker
- attr g.printer.3d.anycubic.i3mega.octoprint icon 3d-printer@black
- attr g.printer.3d.anycubic.i3mega.octoprint plugin_psucontrol 1
- attr g.printer.3d.anycubic.i3mega.octoprint room Allgemein
- attr g.printer.3d.anycubic.i3mega.octoprint stateFormat {\
- use POSIX qw(strftime);;\
- my $state = ReadingsVal("$name", "state", '');;\
- \
- return "Kein aktiver Druckvorgang" if ($state ne "Printing");;\
- \
- return sprintf(\
- "Drucke Objekt <strong>%s</strong>, abgeschlossen am <strong>%s</strong>",\
- ReadingsVal("$name", "job_name", "unbekannt"),\
- strftime('%A, den %d.%m.%Y, um %X', localtime ReadingsVal("$name", "job_endtime", 0))\
- ) if ($state eq "Printing")\
- }
- attr g.printer.3d.anycubic.i3mega.octoprint userReadings \
- job_name {\
- use File::Basename;;\
- return basename(ReadingsVal("$name", "job_file_display", ""), ".gcode");;\
- },\
- job_endtime {\
- my $now = time();;\
- my $duration = ReadingsVal("$name", "progress_printTimeLeft", 0);;\
- my $end = $now + $duration;;\
- },
Add Comment
Please, Sign In to add comment