mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
70_LaMetric2: fix exception for chart setter
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@17967 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
cfae7a9e62
commit
c9fbafcc9d
@ -267,7 +267,7 @@ sub LaMetric2_Define($$) {
|
|||||||
|
|
||||||
$hash->{HOST} = $host;
|
$hash->{HOST} = $host;
|
||||||
$hash->{".API_KEY"} = $apikey;
|
$hash->{".API_KEY"} = $apikey;
|
||||||
$hash->{VERSION} = "2.2.1";
|
$hash->{VERSION} = "2.2.2";
|
||||||
$hash->{INTERVAL} =
|
$hash->{INTERVAL} =
|
||||||
$interval && looks_like_number($interval) ? $interval : 60;
|
$interval && looks_like_number($interval) ? $interval : 60;
|
||||||
$hash->{PORT} = $port && looks_like_number($port) ? $port : 4343;
|
$hash->{PORT} = $port && looks_like_number($port) ? $port : 4343;
|
||||||
@ -1589,7 +1589,7 @@ sub LaMetric2_SetNotification {
|
|||||||
my $str = $h->{chart};
|
my $str = $h->{chart};
|
||||||
$str =~ s/[^\d,.]//g;
|
$str =~ s/[^\d,.]//g;
|
||||||
foreach ( split( /,/, $str ) ) {
|
foreach ( split( /,/, $str ) ) {
|
||||||
push @{ $values{chart} }, round( $_, 0 );
|
push @{ $values{chart}{chartData} }, round( $_, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
# take object+model defaults for this frame type
|
# take object+model defaults for this frame type
|
||||||
@ -1971,7 +1971,13 @@ sub LaMetric2_SetNotification {
|
|||||||
text => "",
|
text => "",
|
||||||
index => $index++,
|
index => $index++,
|
||||||
}
|
}
|
||||||
);
|
)
|
||||||
|
|
||||||
|
# only if there is no other
|
||||||
|
# non-text frame afterwards
|
||||||
|
if ( !defined( $values{metric} )
|
||||||
|
&& !defined( $values{chart} )
|
||||||
|
&& !defined( $values{goal} ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
# regular frames
|
# regular frames
|
||||||
@ -2021,10 +2027,9 @@ sub LaMetric2_SetNotification {
|
|||||||
|
|
||||||
if ( $values{chart} ) {
|
if ( $values{chart} ) {
|
||||||
$values{chart}{index} = $index++;
|
$values{chart}{index} = $index++;
|
||||||
push @{ $notification{model}{frames} },
|
push @{ $notification{model}{frames} }, $values{chart};
|
||||||
( { chartData => $values{chart} } );
|
|
||||||
readingsBulkUpdate( $hash, "lastChart",
|
readingsBulkUpdate( $hash, "lastChart",
|
||||||
join( ',', @{ $values{chart} } ) );
|
join( ',', @{ $values{chart}{chartData} } ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
readingsEndUpdate( $hash, 1 );
|
readingsEndUpdate( $hash, 1 );
|
||||||
@ -2220,7 +2225,7 @@ sub LaMetric2_IsDuringTimeframe($$;$) {
|
|||||||
<code><b>metric*</b> </code>- type: n/a - All other options described for the metric-setter can be used here by adding the prefix 'metric' to it.<br>
|
<code><b>metric*</b> </code>- type: n/a - All other options described for the metric-setter can be used here by adding the prefix 'metric' to it.<br>
|
||||||
<br>
|
<br>
|
||||||
<code><b>app</b> </code>- type: text - app_name to push this message to that particular app. Requires matching token parameter (see below).<br>
|
<code><b>app</b> </code>- type: text - app_name to push this message to that particular app. Requires matching token parameter (see below).<br>
|
||||||
<code><b>token</b> </code>- type: text - Private access token to be used when pushing data to an app. Can be retreived from <a href="https://developer.lametric.com/applications/list">developer.lametric.com/applications/app/<app_number></a> of the corresponding app.<br>
|
<code><b>token</b> </code>- type: text - Private access token to be used when pushing data to an app. Can be retrieved from <a href="https://developer.lametric.com/applications/list">developer.lametric.com/applications/app/<app_number></a> of the corresponding app.<br>
|
||||||
<br>
|
<br>
|
||||||
Examples:
|
Examples:
|
||||||
<ul>
|
<ul>
|
||||||
@ -2353,7 +2358,7 @@ sub LaMetric2_IsDuringTimeframe($$;$) {
|
|||||||
<br><br>
|
<br><br>
|
||||||
So send data to a private/shared app, use 'push' as action_id. It will require the access token as parameter so that the device will accept data for that particular app:<br>
|
So send data to a private/shared app, use 'push' as action_id. It will require the access token as parameter so that the device will accept data for that particular app:<br>
|
||||||
<br>
|
<br>
|
||||||
<code><b>token</b> </code>- type: text - Private access token to be used when pushing data to an app. Can be retreived from <a href="https://developer.lametric.com/applications/list">developer.lametric.com/applications/app/<app_number></a> of the corresponding app.<br>
|
<code><b>token</b> </code>- type: text - Private access token to be used when pushing data to an app. Can be retrieved from <a href="https://developer.lametric.com/applications/list">developer.lametric.com/applications/app/<app_number></a> of the corresponding app.<br>
|
||||||
<br>
|
<br>
|
||||||
Examples:
|
Examples:
|
||||||
<ul>
|
<ul>
|
||||||
@ -2384,11 +2389,11 @@ sub LaMetric2_IsDuringTimeframe($$;$) {
|
|||||||
</ul><br>
|
</ul><br>
|
||||||
<br>
|
<br>
|
||||||
<ul>
|
<ul>
|
||||||
<b>channelUp</b>
|
<b>channelDown</b>
|
||||||
<ul>
|
<ul>
|
||||||
<code>set <LaMetric2_device> channelUp</code><br>
|
<code>set <LaMetric2_device> channelDown</code><br>
|
||||||
<br>
|
<br>
|
||||||
When the Radio app is active, it will switch to the next radio station.
|
When the Radio app is active, it will switch to the previous radio station.
|
||||||
</ul>
|
</ul>
|
||||||
</ul><br>
|
</ul><br>
|
||||||
<br>
|
<br>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user