2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 03:06:37 +00:00

71_ZM_Monitor: improving statistics

git-svn-id: https://svn.fhem.de/fhem/trunk@20406 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
delmar 2019-10-25 06:59:21 +00:00
parent 6626b3e8be
commit b580e5221f
3 changed files with 7 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.
- change: 71_ZM_Monitor: now writing internal 'model'
- feature: 74_AMADDevice: add class support for openApp,
fix bug then change attr remoteServer set Internal MODEL
- change: 76_SMAInverter: readings bat_loadtotal / bat_loadtoday included,

View File

@ -474,8 +474,9 @@ sub ZoneMinder_UpdateMonitorAttributes {
my $function = ZoneMinder_GetConfigValueByKey($hash, $monitorData, 'Function');
my $enabled = ZoneMinder_GetConfigValueByKey($hash, $monitorData, 'Enabled');
my $streamReplayBuffer = ZoneMinder_GetConfigValueByKey($hash, $monitorData, 'StreamReplayBuffer');
my $monitorType = ZoneMinder_GetConfigValueByKey($hash, $monitorData, 'Type');
my $msg = "monitor:$monitorId|$function|$enabled|$streamReplayBuffer";
my $msg = "monitor:$monitorId|$function|$enabled|$streamReplayBuffer|$monitorType";
my $dispatchResult = Dispatch($hash, $msg, undef);
}

View File

@ -392,11 +392,12 @@ sub ZM_Monitor_handleMonitorUpdate {
my ( $io_hash, $message ) = @_;
my $ioName = $io_hash->{NAME};
my @msgTokens = split(/\|/, $message); #$message = "$monitorId|$function|$enabled|$streamReplayBuffer";
my @msgTokens = split(/\|/, $message); #$message = "$monitorId|$function|$enabled|$streamReplayBuffer|$monitorType";
my $zmMonitorId = $msgTokens[0];
my $function = $msgTokens[1];
my $enabled = $msgTokens[2];
my $streamReplayBuffer = $msgTokens[3];
my $monitorType = $msgTokens[4];
my $logDevAddress = $ioName.'_'.$zmMonitorId;
if ( my $hash = $modules{ZM_Monitor}{defptr}{$logDevAddress} ) {
@ -406,6 +407,8 @@ sub ZM_Monitor_handleMonitorUpdate {
my $bufferChanged = readingsBulkUpdateIfChanged($hash, 'streamReplayBuffer', $streamReplayBuffer);
readingsEndUpdate($hash, 1);
$hash->{model} = $monitorType;
ZM_Monitor_UpdateStreamUrls($hash);
return $hash->{NAME};