biemond / solaredge.modbus

Homey Solaredge modbus app
GNU General Public License v3.0
7 stars 8 forks source link

addCapability should not be called this many times #66

Open sorted-bits opened 4 months ago

sorted-bits commented 4 months ago

As a fellow Homey app developer, I was looking through the code as I am planning to support a Modbus TCP device as well, to see if there are any leads or ideas that I could use in my app.

I noticed that on every processResult you are calling addCapability on all capabilities, but this is really putting a lot of burden on the Homey device itself.

Check out: https://apps.developer.homey.app/guides/how-to-breaking-changes#adding-capabilities

I understand that you just want to add a capability once you have received data for it, but maybe these calls can be guarded?

biemond commented 3 months ago

hey, thanks let me check.