2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-25 03:44:52 +00:00

98_vitoconnect.pm: Small bug fixes, removed warnings

git-svn-id: https://svn.fhem.de/fhem/trunk@29620 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
stefanru 2025-02-04 23:23:42 +00:00
parent 952d013ced
commit 90aac5bbfb

View File

@ -91,6 +91,7 @@ use FHEM::SynoModules::SMUtils qw (
); # Hilfsroutinen Modul
my %vNotesIntern = (
"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",
"0.6.0" => "23.01.2025 Total rebuild of initialization and gw handling. In case of more than one installation or gw you have to set it via".
@ -1369,15 +1370,15 @@ sub vitoconnect_Set {
# Setter für Device Werte rufen
if (AttrVal( $name, 'vitoconnect_raw_readings', 0 ) eq "1" ) {
#use new dynamic parsing of JSON to get raw setters
$val .= vitoconnect_Set_New ($hash,$name,$opt,@args);
$val .= vitoconnect_Set_New ($hash,$name,$opt,@args) // '';
}
elsif (AttrVal( $name, 'vitoconnect_mapping_roger', 0 ) eq "1" ) {
#use roger setters
$val .= vitoconnect_Set_Roger ($hash,$name,$opt,@args);
$val .= vitoconnect_Set_Roger ($hash,$name,$opt,@args) // '';
}
else {
#use svn setters
$val .= vitoconnect_Set_SVN ($hash,$name,$opt,@args);
$val .= vitoconnect_Set_SVN ($hash,$name,$opt,@args) // '';
}
@ -3655,7 +3656,7 @@ sub vitoconnect_action {
}
else { # Befehl korrekt ausgeführt
readingsSingleUpdate($hash,"Aktion_Status","OK: ".$opt." ".$Text,1); # Reading 'Aktion_Status' setzen
#Log3($name,1,$name.",vitoconnect_action: set name:".$name." opt:".$opt." text:".$Text.", korrekt ausgefuehrt: ".$err." :: ".$msg); # TODO: Wieder weg machen $err
# Log3($name,1,$name.",vitoconnect_action: set name:".$name." opt:".$opt." text:".$Text.", korrekt ausgefuehrt: ".$err." :: ".$msg); # TODO: Wieder weg machen $err
Log3($name,3,$name.",vitoconnect_action: set name:".$name." opt:".$opt." text:".$Text.", korrekt ausgefuehrt");
# Spezial Readings update
@ -3667,6 +3668,7 @@ sub vitoconnect_action {
$Text = "1";
}
readingsSingleUpdate($hash,$opt,$Text,1); # Reading updaten
# Log3($name,1,$name.",vitoconnect_action: reading upd1 hash:".$hash." opt:".$opt." text:".$Text); # TODO: Wieder weg machen $err
# Spezial Readings update, activate mit temperatur siehe brenner Vitoladens300C
if ($feature =~ /(.*)\.deactivate/) {
@ -3676,6 +3678,7 @@ sub vitoconnect_action {
$Text = "1";
}
readingsSingleUpdate($hash,$opt,$Text,1); # Reading updaten
# Log3($name,1,$name.",vitoconnect_action: reading upd2 hash:".$hash." opt:".$opt." text:".$Text); # TODO: Wieder weg machen $err
Log3($name,4,$name.",vitoconnect_action: set feature:".$feature." data:".$data.", korrekt ausgefuehrt"); #4
@ -3693,19 +3696,19 @@ sub vitoconnect_errorHandling {
#Log3 $name, 1, "$name - errorHandling StatusCode: $items->{statusCode} ";
if (!$items->{statusCode} eq "") {
if (defined $items->{statusCode} && !$items->{statusCode} eq "") {
Log3 $name, 4,
"$name - statusCode: $items->{statusCode} "
. "errorType: $items->{errorType} "
. "message: $items->{message} "
. "error: $items->{error}";
"$name - statusCode: " . ($items->{statusCode} // 'undef') . " "
. "errorType: " . ($items->{errorType} // 'undef') . " "
. "message: " . ($items->{message} // 'undef') . " "
. "error: " . ($items->{error} // 'undef');
readingsSingleUpdate(
$hash,
"state",
"statusCode: $items->{statusCode} "
. "errorType: $items->{errorType} "
. "message: $items->{message} "
. "error: $items->{error}",
"statusCode: " . ($items->{statusCode} // 'undef') . " "
. "errorType: " . ($items->{errorType} // 'undef') . " "
. "message: " . ($items->{message} // 'undef') . " "
. "error: " . ($items->{error} // 'undef'),
1
);
if ( $items->{statusCode} eq "401" ) {