DigitalShoestringSolutions / PowerMonitoring

GNU General Public License v3.0
0 stars 1 forks source link

Analysis: setting default voltage and power factor in user config #48

Open tobyaharris opened 6 days ago

tobyaharris commented 6 days ago

SMDH is sending a DC power monitoring solution. We imagine in the field that the user may change the machine name. We think it most likely that new machines will have a 12V DC power supply so want to set the voltage to 12 for all unnamed machines. Hence, as seen in branch backup, the 230s had to be swapped out for 12s in user unfriendly places. See not just module_config.toml but electrical.py

In the voltage / power factor case, a default is sensible. When moving the system between machines, they will probably share a power supply. But - could that default be defined in analysis/user_config.toml? More than just available in the user config to overwrite the module config, could the user config be the single source of truth for this variable?

On the wider question - I'm uncomfortable with the style of always having defaults and overwriting them in cases where the user really should be aware of the variable and know what it is set to. Whilst having a live / functional value for almost every setting is handy for quick start, it does get confusing. E.g. I've seen users change the CT ratio but not uncomment the line, then wonder why their data is a factor of 3 out. In many cases I would rather raise a NotConfiguredError or similar?

tobyaharris commented 1 day ago

Greg: yes please. Can be done in user_config.

tobyaharris commented 1 day ago

It's a quick win, I'll try and finish this today.