From 021f2f87721a8f8b9c6685c40f1858da813d1e5e Mon Sep 17 00:00:00 2001 From: betateilchen <> Date: Wed, 27 Dec 2017 15:01:42 +0000 Subject: [PATCH] 55_InfoPanel.pm: create empty layout on define file if not already existent git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@15708 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- FHEM/55_InfoPanel.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/FHEM/55_InfoPanel.pm b/FHEM/55_InfoPanel.pm index 3a007e73f..7532d05d5 100644 --- a/FHEM/55_InfoPanel.pm +++ b/FHEM/55_InfoPanel.pm @@ -260,8 +260,15 @@ sub btIP_readLayout { my ($err, @layoutfile) = FileRead($filename); if($err) { +# Log 1, "InfoPanel $name: $err"; +# $hash->{fhem}{layout} = "text ERROR 50 50 \"Error on reading layout!\""; Log 1, "InfoPanel $name: $err"; $hash->{fhem}{layout} = "text ERROR 50 50 \"Error on reading layout!\""; + my ($e,@layout) = FileRead('./FHEM/template.layout'); + unless ($e){ + FileWrite($filename,@layout); + $hash->{fhem}{layout} = "text ERROR 50 50 \"Please edit layoutfile now.\""; + } } else { $hash->{fhem}{layout} = join("\n", @layoutfile); while($hash->{fhem}{layout} =~ m/\@include/ && $level < 1000) {