2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-28 15:04:51 +00:00

95_YAAHM.pm: Bugfix

git-svn-id: https://svn.fhem.de/fhem/trunk@16033 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
phenning 2018-01-29 07:25:53 +00:00
parent f3916a0897
commit 6b2bc397b1
4 changed files with 21 additions and 12 deletions

View File

@ -47,7 +47,7 @@ my $yaahmname;
my $yaahmlinkname = "Profile"; # link text my $yaahmlinkname = "Profile"; # link text
my $yaahmhiddenroom = "ProfileRoom"; # hidden room my $yaahmhiddenroom = "ProfileRoom"; # hidden room
my $yaahmpublicroom = "Unsorted"; # public room my $yaahmpublicroom = "Unsorted"; # public room
my $yaahmversion = "1.46"; my $yaahmversion = "1.47";
my $firstcall = 1; my $firstcall = 1;
my %yaahm_transtable_EN = ( my %yaahm_transtable_EN = (
@ -1886,16 +1886,25 @@ sub YAAHM_sayWeeklyTime($$$) {
($hl,$ml) = split(':',strftime('%H:%M', localtime(time))); ($hl,$ml) = split(':',strftime('%H:%M', localtime(time)));
$tl = 60*$hl+$ml; $tl = 60*$hl+$ml;
#-- today off AND tomorrow any time or off #-- today off AND tomorrow any time or off => compare this time with current time
if( $tod =~ /^off.*/ ){ if( $tod =~ /^off.*/ ){
#-- special time #-- tomorrow any time
if( $tom =~ /(\d?\d):(\d\d)(:(\d\d))?/ && $tom !~ /.*\(off\)$/ ){ if( $tom =~ /(\d?\d):(\d\d)(:(\d\d))?/ && $tom !~ /.*\(off\)$/ ){
$hw = $1*1; #Log 1,"===========> |$1|$2|$3|$4";
$mw = $2*1; ($ht,$mt) = split('[\s:]',$tom);
$pt = sprintf("%d:%02d",$hw,$mw)." ".lc($yaahm_tt->{"tomorrow"}); $tt=60*$ht+$mt;
$msg .= " ".lc($yaahm_tt->{"tomorrow"})." $hw ".$yaahm_tt->{"clock"}; #-- wakeup tomorrow later than now
$msg .=" $mw" if( $tt < $tl ){
if( $mw != 0 ); $hw = $1*1;
$mw = $2*1;
$pt = sprintf("%d:%02d",$hw,$mw)." ".lc($yaahm_tt->{"tomorrow"});
$msg .= " ".lc($yaahm_tt->{"tomorrow"})." $hw ".$yaahm_tt->{"clock"};
$msg .=" $mw"
if( $mw != 0 );
}else{
$pt = "off ".lc($yaahm_tt->{"today"});
$msg .= " ".lc($yaahm_tt->{"today"})." ".$yaahm_tt->{"swoff"};
}
}elsif( $tom =~ /^off/ || $tom =~ /.*\(off\)$/ ){ }elsif( $tom =~ /^off/ || $tom =~ /.*\(off\)$/ ){
$pt = "off ".lc($yaahm_tt->{"today"})." ".$yaahm_tt->{"and"}." ".lc($yaahm_tt->{"tomorrow"}); $pt = "off ".lc($yaahm_tt->{"today"})." ".$yaahm_tt->{"and"}." ".lc($yaahm_tt->{"tomorrow"});
$msg .= " ".lc($yaahm_tt->{"today"})." ".$yaahm_tt->{"and"}." ".lc($yaahm_tt->{"tomorrow"})." ".$yaahm_tt->{"swoff"}; $msg .= " ".lc($yaahm_tt->{"today"})." ".$yaahm_tt->{"and"}." ".lc($yaahm_tt->{"tomorrow"})." ".$yaahm_tt->{"swoff"};

View File

@ -10,7 +10,7 @@
//------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------
var req = new XMLHttpRequest(); var req = new XMLHttpRequest();
req.open('HEAD', document.location.href, false); req.open('GET', document.location.href, false);
req.send(null); req.send(null);
var csrfToken = req.getResponseHeader('X-FHEM-csrfToken'); var csrfToken = req.getResponseHeader('X-FHEM-csrfToken');
if( csrfToken == null ){ if( csrfToken == null ){

View File

@ -10,7 +10,7 @@
//------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------
var req = new XMLHttpRequest(); var req = new XMLHttpRequest();
req.open('HEAD', document.location.href, false); req.open('GET', document.location.href, false);
req.send(null); req.send(null);
var csrfToken = req.getResponseHeader('X-FHEM-csrfToken'); var csrfToken = req.getResponseHeader('X-FHEM-csrfToken');
if( csrfToken == null ){ if( csrfToken == null ){

View File

@ -10,7 +10,7 @@
//------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------
var req = new XMLHttpRequest(); var req = new XMLHttpRequest();
req.open('HEAD', document.location.href, false); req.open('GET', document.location.href, false);
req.send(null); req.send(null);
var csrfToken = req.getResponseHeader('X-FHEM-csrfToken'); var csrfToken = req.getResponseHeader('X-FHEM-csrfToken');
if( csrfToken == null ){ if( csrfToken == null ){