Wago group feature
Aim is to get from config in a session a group of wago keys from a unique object,a wagogroup. Wago keys in a wago group contains all or part of keys of the underneath wago controllers. One can import one wago group in a session and access to all keys of its controllers without importing in the session the individual wago controller.
Proposed yml:
- name: mywagos
wago:
- wagoname: wcid10a
keys: filt1, filt2
- wagoname: wcid10b
In that example, only keys filt1
and filt2
are imported from wcid10a and ALL keys from wcid10b are imported inside the wago group.
Functionnalties from the wagogroup class are:
mywagos.<any-key>.set(<value>)
mywagos.<any-key>.get()
mywagos.set('key1',val1, 'key2',val2,......)
mywagos.get('key1','key2'......)
mywagos.get_keys() --> return the list of available keys as a string list
mywagos.show() --> print out all the key-value pairs
mywagos.controllers() --> dict of name, wago controller object underneath
mywagos.get_controller(key) --> return the wago controller object which hold the given key.
The wagogroup needs to provide a counter API which is the union of all the wago controller counters configured.
examples:
> ct(1,mywagos) -> will count on all counters configured fro wcid10a and wcid10b
Duplicate keys in wago controllers cannot be handled and a clear error message should be raised on wago group configuration.