From 05f27b8f9553fe6f945976bc50b796bebc4bf53f Mon Sep 17 00:00:00 2001 From: thomyd Date: Sat, 14 Feb 2015 22:04:45 +0000 Subject: [PATCH] SOMFY: Bugfix for wrong attributename when calculating the updatetime. The attribute was misspelled, so the updatetime when driving up was not calculated correctly. Also updated the version to 1.5 git-svn-id: https://svn.fhem.de/fhem/trunk@7988 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/10_SOMFY.pm | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index c3b7055f7..186b742f9 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: SOMFY: use correct attributename when calculating updatetime - feature: 95_FLOORPLAN.pm: arrange by drag&drop, copy, rename, delete processes userattr fp_ - added: 30_LIGHTIFY.pm: New module for OSRAM LIGHTIFY gateways diff --git a/fhem/FHEM/10_SOMFY.pm b/fhem/FHEM/10_SOMFY.pm index c34aff660..02f4c52b8 100644 --- a/fhem/FHEM/10_SOMFY.pm +++ b/fhem/FHEM/10_SOMFY.pm @@ -1,11 +1,10 @@ ###################################################### -# $Id$ +# $Id: 10_SOMFY.pm 6645 2014-10-01 07:55:26Z thomyd $ # # SOMFY RTS / Simu Hz protocol module for FHEM # (c) Thomas Dankert # -# This will only work if you flashed your CUL with -# the newest culfw (support for "Y" command). +# Needs CULFW V 1.59 or higher (support for "Y" command). # # Published under GNU GPL License, v2 # @@ -27,6 +26,8 @@ # # 1.4 thomyd Implemented fallback on/off-for-timer methods and only show warning about stop/go-my # if the positioning attributes are set. +# +# 1.5 thomyd Bugfix for wrong attribute names when calculating the updatetime (drive-up-...) ###################################################### @@ -388,7 +389,7 @@ sub SOMFY_CalcNewPos($) { if($oldpos > 100) { $dt = $dt - $t1up100; $newpos = $oldpos - (100 * $dt / ($t1upopen - $t1up100)); - $newpos = 100 if($newpos > 100), # driven only short between close and pos 100! + $newpos = 100 if($newpos > 100); # driven only short between close and pos 100! } else { $newpos = $oldpos - (100 * $dt / ($t1upopen - $t1up100)); @@ -469,7 +470,7 @@ sub SOMFY_Set($@) { $cmd = 'off'; $hash->{move} = 'up'; $newpos = 0; - $updatetime = (AttrVal($name,'drive-up-time-open',25) - AttrVal($name,'drive-up-time-100',0)) * $oldpos / 100; + $updatetime = (AttrVal($name,'drive-up-time-to-open',25) - AttrVal($name,'drive-up-time-to-100',0)) * $oldpos / 100; } elsif ($cmd eq 'on') { $hash->{move} = 'down';