Instead of Current_1 / Power_1 / Energy_1 in config, a user can now have a structured approach:
channel_1:
current: Current 1
power: Power 1
energy: Energy 1
The current / power / energy keys in yaml can still be used as full sensor schemas and fields can be overridden in yaml.
I also tidied up the actual c++ code, de-duplicating a lot of the same code, and also splitting the reads so it only reads 1 channel per loop.
It will also only read the data for a sensor if that sensor is configured by the user now and doesn't waste time getting info unnecessarily.
Instead of Current_1 / Power_1 / Energy_1 in config, a user can now have a structured approach:
The
current
/power
/energy
keys in yaml can still be used as full sensor schemas and fields can be overridden in yaml.I also tidied up the actual c++ code, de-duplicating a lot of the same code, and also splitting the reads so it only reads 1 channel per
loop
. It will also only read the data for a sensor if that sensor is configured by the user now and doesn't waste time getting info unnecessarily.