2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +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:
delmar 2019-11-06 14:11:20 +00:00
parent 0df84a444f
commit bdf9ebb24d
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. # 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. # 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 - bugfix: 70_ZoneMinder: fixed uninitialized value warnings
- feature: 74_XiaomiBTLESens: code implementation for ClearGrassSens - feature: 74_XiaomiBTLESens: code implementation for ClearGrassSens
- bugfix: 73_AutoShuttersControl: fix window close fn then Mode_Up off - bugfix: 73_AutoShuttersControl: fix window close fn then Mode_Up off

View File

@ -262,6 +262,7 @@ sub ZoneMinder_API_Login_Callback {
} }
$apiState = 'opened'; $apiState = 'opened';
ZoneMinder_SimpleGet($hash, "$zmApiUrl/monitors.json", \&ZoneMinder_API_UpdateMonitors_Callback);
} }
if ( $apiVersion eq 'post132' ) { if ( $apiVersion eq 'post132' ) {
@ -495,7 +496,8 @@ sub ZoneMinder_API_CreateMonitors_Callback {
next if ! defined $monitorId; next if ! defined $monitorId;
if ( $monitorId =~ /^[0-9]+$/ ) { 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); my $zmApiUrl = ZoneMinder_getZmApiUrl($hash);

View File

@ -425,11 +425,12 @@ sub ZM_Monitor_handleMonitorCreation {
my ( $io_hash, $message ) = @_; my ( $io_hash, $message ) = @_;
my $ioName = $io_hash->{NAME}; my $ioName = $io_hash->{NAME};
my @msgTokens = split(/\|/, $message); #$message = "$monitorId"; my @msgTokens = split(/\|/, $message); #$message = "$monitorId|$monitorType";
my $zmMonitorId = $msgTokens[0]; my $zmMonitorId = $msgTokens[0];
my $logDevAddress = $ioName.'_'.$zmMonitorId; my $logDevAddress = $ioName.'_'.$zmMonitorId;
if ( my $hash = $modules{ZM_Monitor}{defptr}{$logDevAddress} ) { if ( my $hash = $modules{ZM_Monitor}{defptr}{$logDevAddress} ) {
$hash->{model} = $msgTokens[1];
return $hash->{NAME}; return $hash->{NAME};
} else { } else {
my $autocreate = "UNDEFINED ZM_Monitor_$logDevAddress ZM_Monitor $zmMonitorId"; my $autocreate = "UNDEFINED ZM_Monitor_$logDevAddress ZM_Monitor $zmMonitorId";