2023 Aug 30, 11:58 PM
(This post was last modified: 2023 Aug 31, 07:51 PM by tutqiunnh.
Edit Reason: Answered question myself
)
Dan,
I'm writing a plugin that uses weewx weather station to emulate the rain sensor function. With a bit of mods to helpers, gpio_pins, and sip I can pass the output of the plugin to the "rain_sensor" value in helpers, no tracebacks. However, when I print out the plugins.__all__ variable it only shows 1 instance of my plugin in the list. But on the homepage dropdown there are 2 in the list and the stations all show "LOADING......" I'm using version 4.1.51.
I disable my plugin and just let the fake_gpio library control the rain_sensor it randomly changes between 1 and 0, stations, all load and homepage functions as expected. I'm sure I'm creating some kind of loop. in sip.py the tweak I made was to assign plugins.__all__ to a global that I could pass to helpers.py so that I can see if the plugin is loaded to ensure that the rain_sensor variable is being set in the check_rain() subroutine. That all seems to work fine. Just don't understand the problem I've created with the plugin to cause the problem.
Thanks,
Bryan
Update: Nevermind. Just had to use a gv.sd and add an new global value for the wx_rain_sensor value to pass between plugin and helpers and issue went away.
I'm writing a plugin that uses weewx weather station to emulate the rain sensor function. With a bit of mods to helpers, gpio_pins, and sip I can pass the output of the plugin to the "rain_sensor" value in helpers, no tracebacks. However, when I print out the plugins.__all__ variable it only shows 1 instance of my plugin in the list. But on the homepage dropdown there are 2 in the list and the stations all show "LOADING......" I'm using version 4.1.51.
I disable my plugin and just let the fake_gpio library control the rain_sensor it randomly changes between 1 and 0, stations, all load and homepage functions as expected. I'm sure I'm creating some kind of loop. in sip.py the tweak I made was to assign plugins.__all__ to a global that I could pass to helpers.py so that I can see if the plugin is loaded to ensure that the rain_sensor variable is being set in the check_rain() subroutine. That all seems to work fine. Just don't understand the problem I've created with the plugin to cause the problem.
Thanks,
Bryan
Update: Nevermind. Just had to use a gv.sd and add an new global value for the wx_rain_sensor value to pass between plugin and helpers and issue went away.