I fixed some of the code of brendanjerwin and added some more features regarding home assistant discovery.
Summary of my changes:
Fix --all option with --mqtt (It can handle unlimited depth of output dictionary)
Fix missing retain flag for hass discovery
Aggregate all sensors into one device in hass discovery
Add proper device_classes and units_of_measurements to hass discovery
Disable print output if mqtt is enabled
Add some debug statements
Only import module paho.mqtt if necessary
I fixed some of the code of brendanjerwin and added some more features regarding home assistant discovery.
Summary of my changes: Fix --all option with --mqtt (It can handle unlimited depth of output dictionary) Fix missing retain flag for hass discovery Aggregate all sensors into one device in hass discovery Add proper device_classes and units_of_measurements to hass discovery Disable print output if mqtt is enabled Add some debug statements Only import module paho.mqtt if necessary
It imports the paho dependency now only if necessary as you mentioned at: https://github.com/dreadnought/python-daly-bms/pull/8