10_EQ3BT: fix wrong date and time on thermostats

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@18384 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
dominikkarall 2019-01-22 21:17:28 +00:00
parent cac0f09340
commit 34043d1f59

View File

@ -8,6 +8,9 @@
#
#############################################################
#
# v2.0.6 - 20190122
# - BUGFIX: fix wrong time on thermostats
#
# v2.0.5 - 20181007
# - BUGFIX: ssh bugfixes by CoolTux
#
@ -535,6 +538,11 @@ sub EQ3BT_execGatttool($) {
}
}
if($value eq "03") {
my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(time);
my $currentDate = sprintf("%02X%02X%02X%02X%02X", $year+1900-2000, $mon+1, $mday, $hour, $min);
$value .= $currentDate;
}
$cmd .= "ssh $sshHost '" if($sshHost ne 'none');
$cmd .= "timeout " . AttrVal($name, "timeout", 15) . " " if($listen);
@ -544,16 +552,6 @@ sub EQ3BT_execGatttool($) {
$cmd .= " 2>&1 /dev/null";
$cmd .= "'" if($sshHost ne 'none');
if($value eq "03") {
my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(time);
my $currentDate = sprintf("%02X%02X%02X%02X%02X", $year+1900-2000, $mon+1, $mday, $hour, $min);
$value .= $currentDate;
}
#my $cmd = "gatttool -b $mac -i $hciDevice --char-write-req --handle=$handle --value=$value";
# if( $sshHost ne 'none' ) {
# $cmd = "ssh $sshHost 'gatttool -b $mac -i $hciDevice --char-write-req --handle=$handle --value=$value";