Tom and Vince, thanks for thoughts. Part of the ‘problem’ is I have separate config sections for the driver and service. They have essentially the same information. At this time about the only reason to have them separate is to allow running as both a driver and service. And about the only reason to do this, is to connect to different brokers.
I currently minimally leverage AbstractConfEditor for driver installation and configuration and a medium commented default weewx.conf in install.py for service invocation. I sometimes forget to update one or the other…
I think I landed on the approach of shipping an example weewx.conf and update MQTTSubscribe to use it to configure itself. It would allow something like this
wee_extension —install development/MQTTSubscribe
edit mqttsubscribe.example.conf
MQTTSubscribe.py simulate service weewx.example.conf
Debug as necessary
MQTTSubscribe.py configure service —update-from weewx.example.conf weewx.conf
Restart weewx
Later in time
MQTTSubscribe.py configure service —export weewx.updated.conf weewx.conf
edit mqttsubscribe.updated.conf
MQTTSubscribe.py simulate service weewx.updated.conf
Debug as necessary
MQTTSubscribe.py configure service —update-from weewx.updated.conf weewx.conf
Restart weewx
I'll also have a --replace-with option and possibly an --add-from. The --replace-with would replace the whole MQTTSubscribe section, providing a poor man's delete. The add-from would only add any missing misinformation
I’m still working out/thinking about how much I want to support interactive configuring for complex, nested, etc. configurations.
I’m also thinking about what type of configuration validation I might be able to add.
rich