athom-tech / esp32-configs

ESP32 configuration for athom device
26 stars 8 forks source link

BL0906 improvements #18

Closed jesserockz closed 1 month ago

jesserockz commented 1 month ago

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.