############################################## # $Id$ # package main; use strict; use warnings; sub attrTmqtt2_roborock_Utils_Initialize { my $hash = shift; return; } # Enter you functions below _this_ line. sub attrTmqtt2_roborock_valetudo2svg { my ($reading, $d, $filename) = @_; my %ret; if($d !~ m/height":(\d+),"width":(\d+).*?floor":\[(.*\])\]/) { $ret{$reading} = "ERROR: Unknown format"; return \%ret; } my ($w,$h,$nums) = ($1, $2, $3); my $svg=<<"EOD"; "; if(!open FD,">$filename") { $ret{$reading} = "ERROR: $filename: $!"; return \%ret; } print FD $svg; close(FD); $ret{$reading} = "Wrote $filename"; return \%ret; } 1; __END__ =pod =item summary helper functions needed for roborock MQTT2_DEVICE =item summary_DE needed Hilfsfunktionen für roborock MQTT2_DEVICE =begin html
attrTmqtt2_roborock_valetudo2svg($$$)