On 10/06/2022, 'Peter Fletcher' via weewx-user
<[email protected]> wrote:
> I know what my current archive interval is (Davis's default of 5 minutes)
> and I don't have any plans to change it, but, in writing user
> services/extensions, which others may conceivably use in the future, I
> don't like to hard-code a value which may be different in a different
> setup. I am sure that the current value of the parameter is accessible to
> code running 'within' weewx (but not within an archive record handler), but
>
> I couldn't find how to access it.
If you are using StdService then config_dict is available.
In UradMon I've used that to fetch the default value along the lines of
sf_int = to_int(config_dict['StdArchive'].get('archive_interval', 300))
Full code from line 292. Adjust to fit.
(Hopefully the following link can be recreated if it gets mangled)
https://github.com/glennmckechnie/weewx-uradmon/blob/73fc63371944d3b5480c1cca0e9fa35feb68c649/bin/user/uradmon.py#L292
--
Cheers
Glenn
rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie
--
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/CAAraAzjkt63QnVF%3D-5cu6z_bS%2BKP03P74LpKwLGAXdK6X8gmoQ%40mail.gmail.com.