StyraHem / ShellyForHASS

Shelly smart home platform for Home Assistant
MIT License
621 stars 111 forks source link

[BUG] Zeroconf sharing not implemented in HA 0.104 #435

Closed martin3000 closed 2 years ago

martin3000 commented 4 years ago

Environment

Describe the bug

Home Assistant writes out the following error: Setup failed for shelly: Unable to import component: cannot import name 'async_get_instance' from 'homeassistant.components.zeroconf' (/home/nuc/.local/lib/python3.8/site-packages/homeassistant/components/zeroconf/init.py)

Steps to Reproduce

Expected behavior

Screenshots

Traceback/Error logs

Additional context

https://github.com/StyraHem/ShellyForHASS/wiki states:

This plugin works on HomeAssitant 0.104.0 or newer.

I think Zeroconf-Sharing with the function async_get_instance was introduced later than 0.104.0

See also #370

martin3000 commented 4 years ago

This statement in __init__.py should check for the HA version:

pys.zeroconf = await zeroconf_async_get_instance(self.hass)

hakana commented 3 years ago

Will be fixed in next release, 0.2.1b2