Julius2342 / pyvlx

PyVLX - controling VELUX windows with Python via KLF 200
GNU Lesser General Public License v3.0
73 stars 26 forks source link

Add zeroconf discovery support #369

Closed pawlizio closed 5 months ago

pawlizio commented 6 months ago

Add zeroconf discovery support for Velux KLF200 devices on the network.

codecov-commenter commented 6 months ago

Codecov Report

Attention: 35 lines in your changes are missing coverage. Please review.

Comparison is base (4ae18e3) 80.00% compared to head (e4e12be) 79.31%.

Files Patch % Lines
pyvlx/discovery.py 31.37% 35 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #369 +/- ## ========================================== - Coverage 80.00% 79.31% -0.69% ========================================== Files 77 78 +1 Lines 3560 3612 +52 ========================================== + Hits 2848 2865 +17 - Misses 712 747 +35 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Julius2342 commented 6 months ago

Shouldnt we integrate this discovery in the pyvlx module itself?

something like: pyvlx = PyVLX(zeroconf=True, loop=loop)

pawlizio commented 6 months ago

I'm not sure, don't we need a separate pyvlx instances for every KLF200 which we find on the network or are we able to manage them inside one pyvlx instance? My idea for this PR was just to use it on HA side when someone start a manual configuration flow for VELUX in the UI, so that we can use zeroconf to check the network and create a list of identified KLF200 devices on the network. Those flows are used before an instance of pyvlx is created. Basically HA supports natively a zeroconf flow step as well. I already considered this in my HA core PR 106660 here.