98_vitoconnect.pm: installationID check at least length 2
git-svn-id: https://svn.fhem.de/fhem/trunk@29627 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -91,6 +91,7 @@ use FHEM::SynoModules::SMUtils qw (
|
||||
); # Hilfsroutinen Modul
|
||||
|
||||
my %vNotesIntern = (
|
||||
"0.7.0" => "06.02.2025 vitoconnect_installationID checked now for at least length 2, see https://forum.fhem.de/index.php?msg=1333072, error handling when setting attributs automatic introduced",
|
||||
"0.6.3" => "04.02.2025 Small bug fixes, removed warnings",
|
||||
"0.6.2" => "28.01.2025 Very small bugfixes ",
|
||||
"0.6.1" => "28.01.2025 Rework of module documentation",
|
||||
@@ -2691,15 +2692,15 @@ sub vitoconnect_Attr {
|
||||
# Zur Zeit kein prüfung, einfacher String
|
||||
if (length($attr_value) != 16) {
|
||||
my $err = "Invalid argument ".$attr_value." to ".$attr_name.". Must be 16 characters long.";
|
||||
Log(5,$name.", vitoconnect_Attr: ".$err);
|
||||
Log(1,$name.", vitoconnect_Attr: ".$err);
|
||||
return $err;
|
||||
}
|
||||
}
|
||||
elsif ($attr_name eq "vitoconnect_installationID") {
|
||||
# Zur Zeit kein prüfung, einfacher String
|
||||
if (length($attr_value) < 5) {
|
||||
my $err = "Invalid argument ".$attr_value." to ".$attr_name.". Must be at least 5 characters long.";
|
||||
Log(5,$name.", vitoconnect_Attr: ".$err);
|
||||
if (length($attr_value) < 2) {
|
||||
my $err = "Invalid argument ".$attr_value." to ".$attr_name.". Must be at least 2 characters long.";
|
||||
Log(1,$name.", vitoconnect_Attr: ".$err);
|
||||
return $err;
|
||||
}
|
||||
}
|
||||
@@ -3054,8 +3055,18 @@ sub vitoconnect_getGwCallback {
|
||||
my ($serial) = keys %devices;
|
||||
my $installationId = $devices{$serial}->{installationId};
|
||||
Log3($name,4,$name." - getGW exactly one Device found set attr: instID: $installationId, serial $serial");
|
||||
CommandAttr (undef, "$name vitoconnect_installationID $installationId");
|
||||
CommandAttr (undef, "$name vitoconnect_serial $serial");
|
||||
my $result;
|
||||
$result = CommandAttr (undef, "$name vitoconnect_installationID $installationId");
|
||||
if ($result) {
|
||||
Log3($name, 1, "Error setting vitoconnect_installationID: $result");
|
||||
return;
|
||||
}
|
||||
$result = CommandAttr (undef, "$name vitoconnect_serial $serial");
|
||||
if ($result) {
|
||||
Log3($name, 1, "Error setting vitoconnect_serial: $result");
|
||||
return;
|
||||
}
|
||||
Log3($name, 4, "Successfully set vitoconnect_serial and vitoconnect_installationID attributes for $name");
|
||||
} else {
|
||||
readingsSingleUpdate($hash,"state","Mehrere Gateways/Devices gefunden, bitte eines auswählen über selectDevice",1);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user