From 7e4ab4c7fc4a2fdc43d787882fbaea05ef5ecd43 Mon Sep 17 00:00:00 2001 From: CoolTux Date: Mon, 16 Jul 2018 08:30:59 +0000 Subject: [PATCH] 42_AptToDate: add Attribut upgradeListReading for Reading in JSON git-svn-id: https://svn.fhem.de/fhem/trunk@16989 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/42_AptToDate.pm | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 4cf57c6b0..2826964ec 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -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. + - feature: 42_AptToDate: add Attribut upgradeListReading for Reading in JSON - change: 98_DOIFtools: added shortcut remove_DOIFtoolsLog to commandref - change: 01_FHEMWEB.pm: default plotEmbed to 0 (Forum #82351) - feature: 73_GardenaSmartBridge: 74_GeardenaSmartDevice: add support for diff --git a/fhem/FHEM/42_AptToDate.pm b/fhem/FHEM/42_AptToDate.pm index 2e98ee7bd..dd114fee9 100644 --- a/fhem/FHEM/42_AptToDate.pm +++ b/fhem/FHEM/42_AptToDate.pm @@ -49,7 +49,7 @@ eval "use JSON;1" or $missingModul .= "JSON "; -my $version = "0.2.2"; +my $version = "0.2.4"; @@ -102,6 +102,7 @@ sub AptToDate_Initialize($) { $hash->{AttrFn} = "AptToDate_Attr"; $hash->{AttrList} = "disable:1 ". "disabledForIntervals ". + "upgradeListReading:1 ". $readingFnAttributes; @@ -690,6 +691,7 @@ sub AptToDate_WriteReadings($$) { } readingsBulkUpdateIfChanged($hash,'updatesAvailable',scalar keys %{$decode_json->{packages}}) if( $hash->{".fhem"}{aptget}{cmd} eq 'getUpdateList' ); + readingsBulkUpdateIfChanged($hash,'upgradeListAsJSON',eval{encode_json($hash->{".fhem"}{aptget}{packages})}) if( AttrVal($name,'upgradeListReading','none') ne 'none'); readingsBulkUpdate($hash,'toUpgrade','successful') if( $hash->{".fhem"}{aptget}{cmd} eq 'toUpgrade' and not defined($hash->{".fhem"}{aptget}{'errors'}) and not defined($hash->{".fhem"}{aptget}{'warnings'}) ); if( $hash->{".fhem"}{aptget}{cmd} eq 'getDistribution' ) { @@ -920,6 +922,7 @@ sub AptToDate_ToDay() { Attributes @@ -983,6 +986,7 @@ sub AptToDate_ToDay() { Attributes