2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 03:06:37 +00:00

57_SSCal: contrib 1.12.0

git-svn-id: https://svn.fhem.de/fhem/trunk@21218 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2020-02-17 21:26:20 +00:00
parent da45d19668
commit ad1f1c48fd

View File

@ -2225,7 +2225,9 @@ sub SSCal_createATdevices ($$$) {
my ($desc,$begin,$status,$isrepeat,$id,@devs,$err,$summary,$location); my ($desc,$begin,$status,$isrepeat,$id,@devs,$err,$summary,$location);
my $room = AttrVal($name, "room", ""); my $room = AttrVal($name, "room", "");
my $assoc = "";
readingsDelete($hash,".associatedWith"); # Deviceassoziationen löschen
@devs = devspec2array("TYPE=at:FILTER=NAME=SSCal.$name.*"); @devs = devspec2array("TYPE=at:FILTER=NAME=SSCal.$name.*");
foreach (@devs) { foreach (@devs) {
@ -2247,16 +2249,21 @@ sub SSCal_createATdevices ($$$) {
$begin =~ s/\s/T/; # Formatierung nach ISO8601 (YYYY-MM-DDTHH:MM:SS) für at-Devices $begin =~ s/\s/T/; # Formatierung nach ISO8601 (YYYY-MM-DDTHH:MM:SS) für at-Devices
my $ao = $begin; my $ao = $begin;
$ao =~ s/[-:]//g; $ao =~ s/[-:]//g;
Log3($name, 4, "$name - Command detected. Create device \"SSCal.$id.$ao\" with type \"at\"."); my $atn = "SSCal.$name.$id.$ao"; # Name neues at-Device
$err = CommandDefine(undef, "SSCal.$name.$id.$ao at $begin $cmd"); Log3($name, 4, "$name - Command detected. Create device \"$atn\" with type \"at\".");
$err = CommandDefine(undef, "$atn at $begin $cmd");
if ($err) { if ($err) {
Log3($name, 1, "$name - Error during create \"at\": $err"); Log3($name, 1, "$name - Error during create \"$atn\": $err");
} else { } else {
CommandAttr(undef,"SSCal.$name.$id.$ao room $location"); CommandSetReading(undef, "$atn .associatedWith $name");
CommandAttr(undef,"SSCal.$name.$id.$ao comment $summary - created automatic by SSCal \"$name\" "); CommandAttr(undef,"$atn room $location");
CommandAttr(undef,"$atn comment $summary - created automatic by SSCal \"$name\" ");
$assoc .= " $atn";
} }
} }
} }
CommandSetReading(undef, "$name .associatedWith $assoc");
return; return;
} }