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

HM support: set_on fix + icons

git-svn-id: https://svn.fhem.de/fhem/trunk@2475 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2013-01-11 09:33:46 +00:00
parent 1e6f3867e8
commit dfc4835758
5 changed files with 23 additions and 5 deletions

View File

@ -49,6 +49,7 @@
- feature: stateFormat (readingsFn modules) and showInternalValues attributes
- feature: new readingsFn modules: FS20 CUL_WS HMS CUL_EM CUL_TX EnOcean ZWave
- feature: telnet client mode
- bugfix: FHEMWEB longpoll misses initial state change (HM: set_on vs. on)
- 2012-10-28 (5.3)
- feature: added functions trim, ltrim, rtrim, UntoggleDirect,

View File

@ -486,7 +486,8 @@ FW_answerCall($)
my $c = $me->{CD};
print $c "HTTP/1.1 200 OK\r\n",
$FW_headercors,
"Content-Type: application/octet-stream; charset=$FW_encoding\r\n\r\n";
"Content-Type: application/octet-stream; charset=$FW_encoding\r\n\r\n",
FW_roomStatesForInform($FW_room);
return -1;
}
@ -1090,7 +1091,7 @@ FW_showRoom()
FW_pO "\n<tr><td><div class=\"devType\">$g</div></td></tr>";
FW_pO "<tr><td>";
FW_pO "<table class=\"block wide\" id=\"$g\">";
FW_pO "<table class=\"block wide\" id=\"TYPE_$g\">";
foreach my $d (sort { lc(AttrVal($a,"alias",$a)) cmp
lc(AttrVal($b,"alias",$b)) } keys %{$group{$g}}) {
@ -2448,6 +2449,21 @@ FW_dumpFileLog($$$)
return $row;
}
sub
FW_roomStatesForInform($)
{
my ($room) = @_;
return "" if(!$room);
my $data = "";
my @rl = devspec2array("room=$room");
foreach my $dn (@rl) {
my ($allSet, $cmdlist, $txt) = FW_devState($dn, "");
$data .= "$dn<<$defs{$dn}{STATE}<<$txt\r\n";
}
return $data;
}
sub
FW_Notify($$)
{
@ -2462,6 +2478,7 @@ FW_Notify($$)
my $rn = AttrVal($dn, "room", "");
if($filter eq "all" || $rn =~ m/\b$filter\b/) {
# Why is saving this stuff needed? FLOORPLAN?
my @old = ($FW_wname, $FW_ME, $FW_longpoll, $FW_ss, $FW_tp, $FW_subdir);
$FW_wname = $ntfy->{SNAME};
$FW_ME = "/" . AttrVal($FW_wname, "webname", "fhem");
@ -2471,7 +2488,7 @@ FW_Notify($$)
$FW_tp = AttrVal($FW_wname, "touchpad", $FW_ss);
my ($allSet, $cmdlist, $txt) = FW_devState($dn, "");
($FW_wname, $FW_ME, $FW_longpoll, $FW_ss, $FW_tp, $FW_subdir) = @old;
$data = "$dn;$dev->{STATE};$txt\n";
$data = "$dn<<$dev->{STATE}<<$txt\n";
} elsif($filter eq "console") {
if($dev->{CHANGED}) { # It gets deleted sometimes (?)

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -30,7 +30,7 @@ FW_doUpdate()
//We wait until it is complete, i.e. terminated by "\n"
lines.pop();
for(var i=FW_curLine; i < lines.length; i++) {
var d = lines[i].split(";", 3); // Complete arg
var d = lines[i].split("<<", 3); // Complete arg
if(d.length != 3)
continue;
var el = document.getElementById(d[0]);
@ -66,7 +66,7 @@ FW_longpoll()
function
FW_delayedStart()
{
setTimeout("FW_longpoll()", 1000);
setTimeout("FW_longpoll()", 100);
}
/*************** LONGPOLL END **************/