mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-09 20:57:11 +00:00
71_ZM_Monitor: improved writing of model internal
git-svn-id: https://svn.fhem.de/fhem/trunk@20463 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
0df84a444f
commit
bdf9ebb24d
@ -1,5 +1,6 @@
|
||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
||||
# Do not insert empty lines here, update check depends on it.
|
||||
- update: 71_ZM_Monitor: improved writing of model internal
|
||||
- bugfix: 70_ZoneMinder: fixed uninitialized value warnings
|
||||
- feature: 74_XiaomiBTLESens: code implementation for ClearGrassSens
|
||||
- bugfix: 73_AutoShuttersControl: fix window close fn then Mode_Up off
|
||||
|
@ -262,6 +262,7 @@ sub ZoneMinder_API_Login_Callback {
|
||||
}
|
||||
|
||||
$apiState = 'opened';
|
||||
ZoneMinder_SimpleGet($hash, "$zmApiUrl/monitors.json", \&ZoneMinder_API_UpdateMonitors_Callback);
|
||||
}
|
||||
|
||||
if ( $apiVersion eq 'post132' ) {
|
||||
@ -495,7 +496,8 @@ sub ZoneMinder_API_CreateMonitors_Callback {
|
||||
|
||||
next if ! defined $monitorId;
|
||||
if ( $monitorId =~ /^[0-9]+$/ ) {
|
||||
my $dispatchResult = Dispatch($hash, "createMonitor:$monitorId", undef);
|
||||
my $monitorType = ZoneMinder_GetConfigValueByKey($hash, $monitorData, 'Type');
|
||||
my $dispatchResult = Dispatch($hash, "createMonitor:$monitorId|$monitorType", undef);
|
||||
}
|
||||
}
|
||||
my $zmApiUrl = ZoneMinder_getZmApiUrl($hash);
|
||||
|
@ -425,11 +425,12 @@ sub ZM_Monitor_handleMonitorCreation {
|
||||
my ( $io_hash, $message ) = @_;
|
||||
|
||||
my $ioName = $io_hash->{NAME};
|
||||
my @msgTokens = split(/\|/, $message); #$message = "$monitorId";
|
||||
my @msgTokens = split(/\|/, $message); #$message = "$monitorId|$monitorType";
|
||||
my $zmMonitorId = $msgTokens[0];
|
||||
my $logDevAddress = $ioName.'_'.$zmMonitorId;
|
||||
|
||||
if ( my $hash = $modules{ZM_Monitor}{defptr}{$logDevAddress} ) {
|
||||
$hash->{model} = $msgTokens[1];
|
||||
return $hash->{NAME};
|
||||
} else {
|
||||
my $autocreate = "UNDEFINED ZM_Monitor_$logDevAddress ZM_Monitor $zmMonitorId";
|
||||
|
Loading…
x
Reference in New Issue
Block a user