From a7ee2a13899cbb237c138b79473cb8441928ad6b Mon Sep 17 00:00:00 2001 From: Otto123 <> Date: Wed, 9 Nov 2022 09:06:31 +0000 Subject: [PATCH] mqtt2.template:fix typo in owntracks template git-svn-id: https://svn.fhem.de/fhem/trunk@26677 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/lib/AttrTemplate/mqtt2.template | 2 +- fhem/contrib/AttrTemplate/99_valetudoUtils.pm | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fhem/FHEM/lib/AttrTemplate/mqtt2.template b/fhem/FHEM/lib/AttrTemplate/mqtt2.template index a5b2a8cfa..d224c739e 100644 --- a/fhem/FHEM/lib/AttrTemplate/mqtt2.template +++ b/fhem/FHEM/lib/AttrTemplate/mqtt2.template @@ -4797,7 +4797,7 @@ attr DEVICE getList\ attr DEVICE setList action:textField $\DEVICETOPIC/cmd {"_type":"cmd","action":$EVTPART1}\ config:textField $\DEVICETOPIC/cmd {"_type":"cmd","action":"setConfiguration","configuration":$EVTPART1}\ waypoints:textField $\DEVICETOPIC/cmd {"_type":"cmd","action":"setWaypoints","waypoints":{"_type":"waypoints","waypoints":[$EVTPART1]}}\ - mode:Quite,Manual,Significant,Move { my %h=(Quite=>'-1',Manual=>'0',Significant=>'1',Move=>'2');fhem("set $NAME config ".qq({"_type":"configuration","monitoring":$h{$EVTPART1}})) }\ + mode:Quiet,Manual,Significant,Move { my %h=(Quiet=>'-1',Manual=>'0',Significant=>'1',Move=>'2');fhem("set $NAME config ".qq({"_type":"configuration","monitoring":$h{$EVTPART1}})) }\ x_raw_payload:textField { my $payload = $EVENT; $payload =~ s/$EVTPART0 //; qq($\DEVICETOPIC/cmd $payload) } attr DEVICE userReadings\ location:lat.* {ReadingsNum($name,'latitude',0).','.ReadingsNum($name,'longitude',0)},\ diff --git a/fhem/contrib/AttrTemplate/99_valetudoUtils.pm b/fhem/contrib/AttrTemplate/99_valetudoUtils.pm index 1592c8d62..1e8bdab90 100644 --- a/fhem/contrib/AttrTemplate/99_valetudoUtils.pm +++ b/fhem/contrib/AttrTemplate/99_valetudoUtils.pm @@ -129,8 +129,8 @@ sub valetudo_c { for (keys %{$decoded}) { if ( $_ eq $load ) {$ret = $devicetopic.'/GoToLocationCapability/go/set '.toJSON $decoded->{$_} } } - } - } + } + } # this part is for study purpose to read the full json segments with the REST API # this part return an array of segment id's according to selected Names from json_segments (complex json) @@ -215,15 +215,15 @@ sub valetudo_r { my $TMF = AttrVal($NAME,'timeformat',''); if ($feature =~ m,(^Att.*|^Basic.*|^Loc.*),) {return {"$value"=>$EVENT} } - if ($feature =~ m,(^Consum.*),) - {return ($TMF ne '') ? {"$value"=>sprintf "%dd %02dh %02dm",valetudo_dhms($EVENT)}: - {"$value"=>$EVENT} } + if ($feature =~ m,(^Consum.*),) + {return ($TMF ne '') ? {"$value"=>sprintf "%dd %02dh %02dm",valetudo_dhms($EVENT)}: + {"$value"=>$EVENT} } if ($feature eq 'BatteryStateAttribute') {return $value eq 'level' ? {"batteryPercent"=>$EVENT}: $value eq 'status' ? {"batteryState"=>$EVENT}:{"$value"=>$EVENT} } if ($feature eq 'CurrentStatisticsCapability') {return $value eq 'area' ? {"$value"=>sprintf("%.2f",($EVENT / 10000))." m²"}: - ($value eq 'time' and $TMF ne '') ? {"$value"=>sprintf "%02d:%02d:%02d",valetudo_dhms($EVENT)}: + ($value eq 'time' and $TMF ne '') ? {"$value"=>sprintf "%02d:%02d:%02d",valetudo_dhms($EVENT)}: {"$value"=>$EVENT} } if ($feature eq 'FanSpeedControlCapability') {return $value eq 'preset' ? {"fanSpeed"=>$EVENT}:{"$value"=>$EVENT} }