Currently, HandleBatteryData has a hard-coded switch statement to update entities for battery Ids 48, 49, and 50. See if we can make this dynamic.
id("some_string") is not supported by esphome, and id(someid${batteryNumber}_value) doesn't compile either. Maybe this can be done with a preprocessor? Or there could be a way to use sensors[i] to loop through all available sensors and find the correct one by string id or name.
Currently, HandleBatteryData has a hard-coded switch statement to update entities for battery Ids 48, 49, and 50. See if we can make this dynamic.
id("some_string") is not supported by esphome, and id(someid${batteryNumber}_value) doesn't compile either. Maybe this can be done with a preprocessor? Or there could be a way to use sensors[i] to loop through all available sensors and find the correct one by string id or name.
https://community.home-assistant.io/t/get-lambda-id-component-name-from-variable/560943/6