From 5bbd7140d7bfe75235e68d0ae33f1358863539b7 Mon Sep 17 00:00:00 2001 From: matscher <> Date: Tue, 23 Sep 2014 19:49:18 +0000 Subject: [PATCH] 09_CUL_FHTTK.pm: modified set option for sync, open and closed with beta CUL firmware based on FW 1.61 git-svn-id: https://svn.fhem.de/fhem/trunk@6605 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/09_CUL_FHTTK.pm | 26 +++++++++++++++++--------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 1ba203eec..7443e3337 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. + - change: 09_CUL_FHTTK.pm: modified set option for sync, open and closed - feature: SYSMON: HTML/Text output for SYSMON-CloneDummies - feature: SYSMON: Method for titled HTML/Text output - added: 34_NUT.pm (maintainer: creideiki) diff --git a/fhem/FHEM/09_CUL_FHTTK.pm b/fhem/FHEM/09_CUL_FHTTK.pm index b19db240a..d57ef7bb5 100644 --- a/fhem/FHEM/09_CUL_FHTTK.pm +++ b/fhem/FHEM/09_CUL_FHTTK.pm @@ -168,16 +168,24 @@ CUL_FHTTK_Set($@) return "Unknown argument $opt ($value), choose one of " . join(" ", @cList); } - # add T as prefix, because of protocol like TCCCCCXX - my $arg = "T" . $hash->{CODE}; + if($opt eq "Syncing" ) { + Log3 $name, 3, "CUL_FHTTK ($name) syncing with FHT80b."; + + IOWrite($hash, "", sprintf("T%s0c", $hash->{CODE})); # 0x0c - sync + # window state switch to closed + + } elsif ($opt eq "Open" ) { + Log3 $name, 3, "CUL_FHTTK ($name) send open window state. ($opt)"; + IOWrite($hash, "", sprintf("T%s01", $hash->{CODE})); # 0x01 - open or 0x81 + + } elsif ($opt eq "Closed" ) { + Log3 $name, 3, "CUL_FHTTK ($name) send closed window state. ($opt)"; - # fhttfk_c2b - $arg .= $fhttfk_c2b{$opt}; - Log3 $name, 5, "$name $opt message with option code: $arg"; - - # write msg to CUL/CUNO - CUL_SimpleWrite($hash, $arg); - Log3 $name, 2, "CUL_FHTTK set $name $opt"; + IOWrite($hash, "", sprintf("T%s02", $hash->{CODE})); # 0x02 - closed or 0x82 + + } else { + return "Unknown argument $a[1], choose one of Syncing Open Closed" + } # update new state readingsSingleUpdate($hash, "state", $opt, 1);