From 19a40f21b5f6ad3fdd8f079530c22eaeeb8d1488 Mon Sep 17 00:00:00 2001 From: moises <> Date: Mon, 1 Jul 2019 11:55:01 +0000 Subject: [PATCH] 32_withings: handle duplicate pwv values git-svn-id: https://svn.fhem.de/fhem/trunk@19756 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/32_withings.pm | 14 +++++++++++--- fhem/FHEM/38_netatmo.pm | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index e5fcb2f69..4fb322d4b 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - bugfix: 32_withings: handle duplicate pwv values - change: 49_SSCam: increase get SID timeout to at least 60 s to avoid potential auth.cgi problem, set compatibility to SVS version 8.2.4, improve disable/enable behavior diff --git a/fhem/FHEM/32_withings.pm b/fhem/FHEM/32_withings.pm index 0f282bd6b..cf656e647 100644 --- a/fhem/FHEM/32_withings.pm +++ b/fhem/FHEM/32_withings.pm @@ -1220,7 +1220,7 @@ sub withings_getDeviceDetail($) { Log3 $name, 2, "$name: json evaluation error on getDeviceDetail ".$@; return undef; } - Log3 $name, 1, "withings: getDeviceDetail json error ".$json->{error} if(defined($json->{error})); + Log3 $name, 1, "$name: getDeviceDetail json error ".$json->{error} if(defined($json->{error})); if($json) { @@ -1946,6 +1946,9 @@ sub withings_parseMeasureGroups($$) { next; } + #fix for duplicate pulseWave value + $reading = "pulseWaveRaw" if($measure->{type} == 91 && $measuregrp->{attrib} == 0); + my $value = $measure->{value} * 10 ** $measure->{unit}; readingsBeginUpdate($hash); @@ -3675,7 +3678,7 @@ sub withings_AuthApp($;$) { $userhash->{helper}{OAuthValid} = (int(time)+$json->{expires_in}) if(defined($json->{expires_in})); readingsSingleUpdate( $userhash, ".refresh_token", $json->{refresh_token}, 1 ) if(defined($json->{refresh_token})); - InternalTimer(gettimeofday()+$json->{expires_in}, "withings_AuthRefresh", $userhash, 0); + InternalTimer(gettimeofday()+$json->{expires_in}-60, "withings_AuthRefresh", $userhash, 0); #https://wbsapi.withings.net/notify?action=subscribe&access_token=a639e912dfc31a02cc01ea4f38de7fa4a1464c2e&callbackurl=http://fhem:remote@gu9mohkaxqdgpix5.myfritz.net/fhem/withings&appli=1&comment=fhem @@ -3728,7 +3731,7 @@ sub withings_AuthRefresh($) { $hash->{helper}{OAuthValid} = (int(time)+$json->{expires_in}) if(defined($json->{expires_in})); readingsSingleUpdate( $hash, ".refresh_token", $json->{refresh_token}, 1 ) if(defined($json->{refresh_token})); - InternalTimer(gettimeofday()+$json->{expires_in}, "withings_AuthRefresh", $hash, 0); + InternalTimer(gettimeofday()+$json->{expires_in}-60, "withings_AuthRefresh", $hash, 0); #https://wbsapi.withings.net/notify?action=subscribe&access_token=a639e912dfc31a02cc01ea4f38de7fa4a1464c2e&callbackurl=http://fhem:remote@gu9mohkaxqdgpix5.myfritz.net/fhem/withings&appli=1&comment=fhem @@ -3909,6 +3912,11 @@ sub withings_DbLog_splitFn($) { $reading = 'heartPulse'; $unit = 'bpm'; } + elsif($event =~ m/pulseWaveRaw/) + { + $reading = 'pulseWaveRaw'; + $unit = 'm/s'; + } elsif($event =~ m/pulseWave/) { $reading = 'pulseWave'; diff --git a/fhem/FHEM/38_netatmo.pm b/fhem/FHEM/38_netatmo.pm index 828de1133..7bda94d39 100644 --- a/fhem/FHEM/38_netatmo.pm +++ b/fhem/FHEM/38_netatmo.pm @@ -6599,7 +6599,7 @@ sub netatmo_weatherIcon()
  • videoquality
    video quality for playlists (HOME - default: medium)
  • webhookURL
    - webhook URL - can include basic auth and ports: http://user:pass@your.url:8080/fhem/netatmo (WEBHOOK)
  • + webhook URL - can include basic auth and port (80 or 443 only!): http://user:pass@your.url:80/fhem/netatmo (WEBHOOK)
  • webhookPoll
    poll home after event from webhook (WEBHOOK - default: 0)
  • ignored_device_ids