Closed Daandamhuis closed 1 year ago
Thanks so much for your work on this. It looks good. Because you've put so many changes/commits in one request it's going to take me a bit of time to work through it, but hopefully can merge it shortly.
Can we not rename the battery_mode_now sensor. I can see why you did it for consistency, but it would be a breaking change. For anyone who has this setup already and might be using it to trigger something else it won't work any more. Thanks
Can we not rename the battery_mode_now sensor. I can see why you did it for consistency, but it would be a breaking change. For anyone who has this setup already and might be using it to trigger something else it won't work any more. Thanks
I've changed it back :)
Thanks so much for your work on this. It looks good. Because you've put so many changes/commits in one request it's going to take me a bit of time to work through it, but hopefully can merge it shortly.
I'm still looking through the code if I can make some optimizations, but for now it seems to be ok. I'm a bit hesitant to check for the kWh or Wh unit on each update. Can Image that it won't change after initializing the battery.
Also I want to check creating 1 collection list instead of 4 different variables.
Thanks again for your work on this. I'm pretty new to python and never knew about list comprehension so I'm learning. Just a couple of areas highlighted above that need resolving. Hope that's ok. Thanks.
Hi !
I've altered it based on your suggestions. I'm still getting used to the Home Assistant way of doing this, so that will come.
Good luck.
Related to: https://github.com/hif2k1/battery_sim/issues/83
Outline
So I saw there were some issues with using the second export and import. I've altered the configuration flow, and the mainly the
__init__.py
. All the other edits where mainly some checks with Flake8 and unused objects.self._sensor_collection
for adding all sensors instead of assigning them each a variable. In theory, we can now addreset_export_sim_sensor
andreset_import_sim_sensor
becamereset_sim_sensor
async_export_reading
andasync_import_reading
becamestart_sensor_tracking
insideasync_source_tracking
To-do
This is the configuration flow file.