2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

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
This commit is contained in:
matscher 2014-09-23 19:49:18 +00:00
parent d90aa1a375
commit 5bbd7140d7
2 changed files with 18 additions and 9 deletions

View File

@ -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)

View File

@ -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);