Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Plugin Education
#1
Hi,

I'm getting my SIP controller set up, and I'd like to write a plugin for some custom weather behaviors.  I've looked through the plugins out there already that perform this type of function, but I'm up against a python knowledge limitation that I could use some help with.

Specifically, the behavior where a plugin appears to change the value of of water scaling through a statement such as this:





gv.sd['wl_monthly_adj’] = (some calculated value)


or



gv.sd['wl_weather’] = (some calculated value)



I don't understand, and I can't find any information on, how adding 'wl_monthly_adj' and a value to the gv.sd dict ends up changing the water scaling that seems to be controlled by gv.sd['wl'].  I assume it has something to do with the options = [ block at the end of gv.py and overloading based on the underscore, but I don't know.



Thanks in advance!
Reply
#2
The percentage of watering time is adjusted in helpers.py in the plugin_adjustment(): function, (Line 278).

The plugin just needs to add a unique element to the gv.sd dictionary with a key starting with 'wl_'

The value of that element will be added to the percent of watering time adjustment.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)