2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-21 01:46:08 +00:00

98_WeekdayTimer.pm: allow newline format in DEF

git-svn-id: https://svn.fhem.de/fhem/trunk@20501 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
Beta-User 2019-11-12 18:30:13 +00:00
parent 3664db2680
commit 3e8ca40584
2 changed files with 5 additions and 4 deletions

View File

@ -167,8 +167,9 @@ sub WeekdayTimer_Undef($$) {
sub WeekdayTimer_Define($$) {
my ($hash, $def) = @_;
WeekdayTimer_InitHelper($hash);
my @a = split("[ \t]+", $def);
#$def =~ s/[\s\\\n]+/ /gm;
#$def =~ s/^([^ ])/ $1/gm;
my @a = split("[ \t\\\n]+", $def);
return "Usage: define <name> $hash->{TYPE} <device> <language> <switching times> <condition|command>"
if(@a < 4);
@ -197,7 +198,7 @@ sub WeekdayTimer_Define($$) {
sub WeekdayTimer_Start($) {
my ($hash) = @_;
my $name = $hash->{NAME};
my @a = split("[ \t]+", $hash->{DEF});
my @a = split("[ \t\\\n]+", $hash->{DEF});
#my @a = split("[ \t]+", $def);
#my $type = shift @a;

View File

@ -25,7 +25,7 @@ par:IODEVNAME;Name of the IO-Device; { AttrVal("DEVICE","IODev",undef) }
par:DEVTYPE;TYPE of the device; { InternalVal("DEVICE","TYPE",undef)}
par:DEVCID;CID of the device as written in the DEF; { InternalVal(AttrVal("DEVICE","IODev",""),"clientId","mosquitto") eq InternalVal("DEVICE","DEF","mosquitto") ? "MQTT2_GeneralBridge" : InternalVal("DEVICE","DEF","mosquitto")}
par:NEWDEVROOM;Room of the calling device; {AttrVal("DEVCID","room","MQTT2_\DEVICE" )}
par:ICON;ICON as set, defaults to mqtt;{ AttrVal("DEVICE","icon","mqtt") }
par:ICON;ICON as set, defaults to mqtt;{ AttrVal("DEVICE","icon","mqtt_bridge_2") }
attr DEVICE icon ICON
defmod DEVCID MQTT2_\DEVICE DEVCID
attr DEVCID bridgeRegexp \