2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-25 16:05:19 +00:00

AutomowerConnect(Device): replace non utf8 character in MODEL

git-svn-id: https://svn.fhem.de/fhem/trunk@27138 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
Ellert 2023-01-28 12:47:58 +00:00
parent 649cc8e597
commit 23f0bfa377
2 changed files with 4 additions and 3 deletions

View File

@ -212,6 +212,7 @@ EOF
$errorjson = undef; $errorjson = undef;
$errortable = undef; $errortable = undef;
$hash->{MODEL} = '';
$attr{$name}{room} = $type if( !defined( $attr{$name}{room} ) ); $attr{$name}{room} = $type if( !defined( $attr{$name}{room} ) );
$attr{$name}{icon} = 'automower' if( !defined( $attr{$name}{icon} ) ); $attr{$name}{icon} = 'automower' if( !defined( $attr{$name}{icon} ) );
if (::AnalyzeCommandChain(undef,"version 74_AutomowerConnect.pm noheader") =~ "^74_AutomowerConnect.pm (.*)Z") { if (::AnalyzeCommandChain(undef,"version 74_AutomowerConnect.pm noheader") =~ "^74_AutomowerConnect.pm (.*)Z") {
@ -482,7 +483,7 @@ sub getMowerResponse {
$pref = 'system'; $pref = 'system';
readingsBulkUpdateIfChanged($hash, $pref."_name", $hash->{helper}{mower}{attributes}{$pref}{name} ); readingsBulkUpdateIfChanged($hash, $pref."_name", $hash->{helper}{mower}{attributes}{$pref}{name} );
my $model = $hash->{helper}{mower}{attributes}{$pref}{model}; my $model = $hash->{helper}{mower}{attributes}{$pref}{model};
$model =~ s/AUTOMOWER./AUTOMOWER®/; $model =~ s/AUTOMOWER./AM/;
$hash->{MODEL} = $model if ( $model && $hash->{MODEL} ne $model ); $hash->{MODEL} = $model if ( $model && $hash->{MODEL} ne $model );
# readingsBulkUpdateIfChanged($hash, $pref."_model", $model ); # readingsBulkUpdateIfChanged($hash, $pref."_model", $model );
readingsBulkUpdateIfChanged($hash, $pref."_serialNumber", $hash->{helper}{mower}{attributes}{$pref}{serialNumber} ); readingsBulkUpdateIfChanged($hash, $pref."_serialNumber", $hash->{helper}{mower}{attributes}{$pref}{serialNumber} );
@ -629,7 +630,6 @@ sub CMDResponse {
my $name = $hash->{NAME}; my $name = $hash->{NAME};
my $type = $hash->{TYPE}; my $type = $hash->{TYPE};
my $statuscode = $param->{code}; my $statuscode = $param->{code};
my $interval = $hash->{helper}{interval};
my $iam = "$type $name CMDResponse:"; my $iam = "$type $name CMDResponse:";
Log3 $name, 1, "\ndebug $iam \n\$statuscode [$statuscode]\n\$err [$err],\n \$data [$data] \n\$param->url $param->{url}" if ( AttrVal($name, 'debug', '') ); Log3 $name, 1, "\ndebug $iam \n\$statuscode [$statuscode]\n\$err [$err],\n \$data [$data] \n\$param->url $param->{url}" if ( AttrVal($name, 'debug', '') );

View File

@ -201,6 +201,7 @@ EOF
$errorjson = undef; $errorjson = undef;
$errortable = undef; $errortable = undef;
$hash->{MODEL} = '';
$attr{$name}{room} = $type if( !defined( $attr{$name}{room} ) ); $attr{$name}{room} = $type if( !defined( $attr{$name}{room} ) );
$attr{$name}{icon} = 'automower' if( !defined( $attr{$name}{icon} ) ); $attr{$name}{icon} = 'automower' if( !defined( $attr{$name}{icon} ) );
if (::AnalyzeCommandChain(undef,"version 75_AutomowerConnectDevice.pm noheader") =~ "^75_AutomowerConnectDevice.pm (.*)Z") { if (::AnalyzeCommandChain(undef,"version 75_AutomowerConnectDevice.pm noheader") =~ "^75_AutomowerConnectDevice.pm (.*)Z") {
@ -302,7 +303,7 @@ sub Notify {
$pref = 'system'; $pref = 'system';
readingsBulkUpdateIfChanged($hash, $pref."_name", $hash->{helper}{mower}{attributes}{$pref}{name} ); readingsBulkUpdateIfChanged($hash, $pref."_name", $hash->{helper}{mower}{attributes}{$pref}{name} );
my $model = $hash->{helper}{mower}{attributes}{$pref}{model}; my $model = $hash->{helper}{mower}{attributes}{$pref}{model};
$model =~ s/AUTOMOWER./AUTOMOWER®/; $model =~ s/AUTOMOWER./AM/;
$hash->{MODEL} = $model if ( $model && $hash->{MODEL} ne $model ); $hash->{MODEL} = $model if ( $model && $hash->{MODEL} ne $model );
# readingsBulkUpdateIfChanged($hash, $pref."_model", $model ); # readingsBulkUpdateIfChanged($hash, $pref."_model", $model );
readingsBulkUpdateIfChanged($hash, $pref."_serialNumber", $hash->{helper}{mower}{attributes}{$pref}{serialNumber} ); readingsBulkUpdateIfChanged($hash, $pref."_serialNumber", $hash->{helper}{mower}{attributes}{$pref}{serialNumber} );