71_ZM_Monitor: improved writing of model internal

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@20463 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
delmar 2019-11-06 14:11:20 +00:00
parent 56068a950b
commit d26dbef718
3 changed files with 6 additions and 2 deletions

View File

@ -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

View File

@ -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);

View File

@ -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";