How can I use the VantageConfigurator class?

58 views
Skip to first unread message

Saverio Guzzo

unread,
Mar 30, 2022, 11:10:47 AM3/30/22
to weewx-user
Hi community,

I'm wondering what is the best way to use the class "VantageConfigurator", defined in the driver/vantage.py.
In particular, I'm interested in knowing what I should do in case I'd like to run the method "VantageConfigurator.setBucketType()".

In my code, I have defined an object "vantage = Vantage()", but how could I run the methods defined within the Configurator class?

Thanks a lot!
Saverio

Tom Keffer

unread,
Mar 30, 2022, 12:00:55 PM3/30/22
to weewx-user
Why would you want to, unless you're planning on reinventing wee_device?

If you need a programmatic interface to change the bucket size, call Vantage.setBucketType()

But, changing the configuration for the bucket size is very rare. If you don't want to use wee_device to do it, then you can do it through your console.

--
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 weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/4ac8fb61-bf12-4955-a099-b7ed3bfcd4c4n%40googlegroups.com.

Saverio Guzzo

unread,
Mar 31, 2022, 3:36:20 AM3/31/22
to weewx-user
Hi Tom,

The motivation comes from the fact that I'm managing a fleet of Davis weather station, each one has its own Raspberry Pi where the vantage.py driver program is running as a standalone.
At startup, I want every console to be configured the same way. This is the reason I wanted to learn how to use the VantageConfigurator class!

Tom Keffer

unread,
Mar 31, 2022, 7:22:08 AM3/31/22
to weewx-user
VantageConfigurator is responsible for converting optparse type commands into appropriate calls to the Vantage API. If you want to go that route, you need to call vantage.configurator_loader() to get an instance of VantageConfiguration(). Then call set_bucket() on that instance. When you're all done, you will have reinvented wee_device.

Or, just call Vantage.setBucketType().

Reply all
Reply to author
Forward
0 new messages