vincentwolsink / home_assistant_micronova_agua_iot

Home Assistant integration controlling heating devices connected via the Agua IOT platform of Micronova
Apache License 2.0
25 stars 15 forks source link

Implement checking of registers being enabled before using them #56

Closed vincentwolsink closed 9 months ago

sonarcloud[bot] commented 9 months ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

jipem01 commented 9 months ago

Hello Vincent,

I'm afraid that the approach of systematic check if enable register is set could be a bit dangerous. I've idebtified at least one register on Nobis stove where enable register is at 0 but the functionnalitie is present for nobis stove (wood_real_power). With my previous pr, if we have a doubt on the usage of enable register (wich is not clear yet following our exchanges...) we can just indicate no enable_register name and then we just ignore the "enable register check". I think you should add a way to activate or deactivate the enable register check for each entity declaration.

vincentwolsink commented 9 months ago

Hi, yes you mentioned that in your PR. We can always add an ‘force_enable’ flag to the entities description if needed. But maybe that specific register will go to 1 when you burned wood once. Since the naming of the enable registers is standardized the need to specify them manually only adds complexity, and the way I did it I can also use the check in other places like inside the climate code. With the current sensors the override flag was not needed yet, so I didn’t add it yet. Prefer to keep the code lean if possible 🙂

jipem01 commented 9 months ago

I think the flag is at 0 when burning pellet and 0 when burning wood (hybrid stove).But still too hot to test!The real wood power register is still displaying the last wood power (3)I agree to keep the code as lean as possible!