Make sure you read the section *Porting to new hardware
<http://www.weewx.com/docs/customizing.htm#porting>* in the Customizing
Guide. It answers some of your questions.

1. The full configuration information is available as the first argument to
your driver loader() function as a dictionary. However, in general, you
should try to keep your driver as modular as possible, and not pick and
choose information from all over the dictionary. Best practice is to have
your driver depend on information in its private stanza. For example, if
your driver is named mywlnk.py, it should have a stanza

[MyWlink]

and look there for all its information. But, there are many exceptions to
this best practice.

2. The function genArchiveRecords() is a *generator function*. If you don't
know what that is, see the section *Generators
<https://wiki.python.org/moin/Generators>* in the Python documentation. It
takes one argument: a timestamp with the last time in the database. Your
function should return all archive records since that time, using a yield
statement. It will be called at startup and at the end of each archive
interval. However, exactly when should not be your concern --- that's the
engine's job.

-tk

On Sun, Jun 21, 2020 at 10:18 AM Florentin Prevost <[email protected]>
wrote:

> Hi,
>
> I worked with the fork of
> https://github.com/vinceskahan/weewx-weatherlinklive-json and I would
> like to ask some questions about driver developpment.
>
> - How can I passed argument of weewx.conf to my driver ? I work to request
> lost data from Weewx on Weatherlink.com because WeatherLink Live don't have
> API to take archive directly and I would like to passed some arguments like
> archive_interval, sql password & etc
> - How work genArchiveRecords when it call? It run as each report ? Or it
> is a loop that waiting to have return values ?
>
>
> Thank you for your answer and support.
>
> --
> You received this message because you are subscribed to the Google Groups
> "weewx-development" 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-development/d04b1fde-25c3-476d-b885-8d45b682976ao%40googlegroups.com
> <https://groups.google.com/d/msgid/weewx-development/d04b1fde-25c3-476d-b885-8d45b682976ao%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-development" 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-development/CAPq0zEDHNGfqZF%3DWGyBSDs6fKPsJ6gibh2eZGMx3%3DJnkk9-F7g%40mail.gmail.com.

Reply via email to