Comments below.

Gary

On Wednesday, 28 June 2023 at 00:19:33 UTC+1 [email protected] wrote:

Is the $current tag the only tag that provides this access? I assume the 
$latest tag also does? 

 
Under most circumstances $latest will return fields from the current 
archive record irrespective of whether they were saved to database or not. 
There are a few exceptions, eg if a binding is specified by the $latest 
tag. Off the top of my head I cannot think of any other tags that make 
non-saved fields available.
 

The $span tag would not be able to get values from those fields, since it's 
an aggregate, right?

 
Correct.
 

Just asking because I have added a check for displaying the battery states, 
like eg. #if $getattr($span($day_delta=1, boundary='midnight'), 
'wh31_ch1_batt').has_data which does not really make sense after 
understanding the internals, it should test against $current.

 
Depends what you are testing and for what purpose, but your '$span' test it 
will require wh31_ch1_batt to be saved to database, testing against $current 
will not have such a requirement. If it is a simple test to determine 
whether you have battery state data to display then I would expect testing 
against $current would be appropriate.

*[...] weewx includes values from the database and the current values of 
all observations in the current values table, also from those which have 
not been archived but are still available in memory from what has been 
provided from the driver [...]*
Where is this data actually stored if not in the database? Is there any way 
to test this out, besides actually using the said driver?

 
WeeWX keeps the current loop packet and current archive record in two 
python dictionaries. WeeWX services have access to and can modify these 
dictionaries via a property of the event object that is passed to each 
WeeWX service. In terms of WeeWX generated reports, access to the current 
archive record is via the $current tag. There is no access to the current 
loop packet. 

Not sure what you mean by 'testing this out', the dictionaries are there 
and used routinely throughout the WeeWX code base.
 

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/377e889c-23e5-4226-8305-2c0643498787n%40googlegroups.com.

Reply via email to