2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

98_telnet.pm: avaluate the title if prompt is not set (Forum #54205)

git-svn-id: https://svn.fhem.de/fhem/trunk@11605 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2016-06-03 18:39:46 +00:00
parent 1f67e291e2
commit 846533e8fb

View File

@ -194,7 +194,13 @@ telnet_Read($)
return if(!$chash);
$chash->{canAsyncOutput} = 1;
$chash->{encoding} = AttrVal($name, "encoding", "utf8");
$chash->{prompt} = AttrVal($name, "prompt", "fhem>");
$chash->{prompt} = AttrVal($name, "prompt",
AttrVal('global','title','fhem>'));
if($chash->{prompt} =~ m/^{.*}$/s) {
$chash->{prompt} = eval $chash->{prompt};
$chash->{prompt} =~ s/\n//;
$chash->{prompt} .= '>'; # Not really nice, but dont know better.
}
syswrite($chash->{CD}, sprintf("%c%c%c", 255, 253, 0) )
if( AttrVal($name, "encoding", "") ); #DO BINARY
$chash->{CD}->flush();