36_ShellyMonitor: Further bugfixes, SHEM recognition
git-svn-id: https://svn.fhem.de/fhem/trunk@27981 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -234,6 +234,7 @@ my %DEVID_MODEL = (
|
|||||||
"SHCB-1" => "shellybulb",
|
"SHCB-1" => "shellybulb",
|
||||||
"SHBLB-1" => "shellybulb",
|
"SHBLB-1" => "shellybulb",
|
||||||
"SHBDUO-1" => "shellybulb",
|
"SHBDUO-1" => "shellybulb",
|
||||||
|
"SHEM" => "shellyem",
|
||||||
"SHEM-3" => "shelly3em",
|
"SHEM-3" => "shelly3em",
|
||||||
"SHMOS-01" => "generic",
|
"SHMOS-01" => "generic",
|
||||||
"SHWT-1" => "generic",
|
"SHWT-1" => "generic",
|
||||||
@@ -265,6 +266,7 @@ my %DEVID_PREFIX = (
|
|||||||
"SHIX3-1" => "shelly_i3",
|
"SHIX3-1" => "shelly_i3",
|
||||||
"SHMOS-01" => "shelly_motion",
|
"SHMOS-01" => "shelly_motion",
|
||||||
"SHTRV-01" => "shelly_trv",
|
"SHTRV-01" => "shelly_trv",
|
||||||
|
"SHEM" => "shelly_em",
|
||||||
"SHEM-3" => "shelly_em3"
|
"SHEM-3" => "shelly_em3"
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -325,8 +327,8 @@ sub ShellyMonitor_Initialize
|
|||||||
# Check which models are available in Mod_Shelly
|
# Check which models are available in Mod_Shelly
|
||||||
LoadModule "Shelly";
|
LoadModule "Shelly";
|
||||||
my $fn = $modules{"Shelly"}{"AttrList"};
|
my $fn = $modules{"Shelly"}{"AttrList"};
|
||||||
if($fn && $fn=~/ model:([^ ]+)( |$)/) {
|
if($fn && $fn=~/(^| )model:([^ ]+)( |$)/) {
|
||||||
map { $shelly_models_by_mod_shelly{$_} = 1 } split (/,/, $1);
|
map { $shelly_models_by_mod_shelly{$_} = 1 } split (/,/, $2);
|
||||||
Log3 $hash->{NAME}, 2, "Shelly-Module loaded supports models: " . join(',', keys %shelly_models_by_mod_shelly);
|
Log3 $hash->{NAME}, 2, "Shelly-Module loaded supports models: " . join(',', keys %shelly_models_by_mod_shelly);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1007,6 +1009,8 @@ sub ShellyMonitor_Set
|
|||||||
CommandAttr ( undef, $dname . ' model ' . $model);
|
CommandAttr ( undef, $dname . ' model ' . $model);
|
||||||
} elsif ($shelly_models_by_mod_shelly{"shellygeneric"}) {
|
} elsif ($shelly_models_by_mod_shelly{"shellygeneric"}) {
|
||||||
CommandAttr ( undef, $dname . ' model shellygeneric');
|
CommandAttr ( undef, $dname . ' model shellygeneric');
|
||||||
|
} elsif ($shelly_models_by_mod_shelly{"generic"}) {
|
||||||
|
CommandAttr ( undef, $dname . ' model generic');
|
||||||
}
|
}
|
||||||
return "Creation of device '$dname' failed" unless ($defs{$dname});
|
return "Creation of device '$dname' failed" unless ($defs{$dname});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user