sbidy / wiz_light

A WiZ Light integration for Home Assistant
MIT License
341 stars 68 forks source link

difference of the smartplug / Bulb for the entities !!!! #226

Closed Mick51 closed 2 years ago

Mick51 commented 2 years ago

When is a difference of the smartplug compared to the Bulb for the entities, the basic application does it, google home also allows it, currently only your integration does not allow it and I do not understand the reason for the moment. You could leave the choice to the user to choose which Wiz equipment to classify as a bulb or smartplug, not requiring automatic detection, but at least being able to differentiate between entities. Before I did it through the configuration file but now that it's no longer possible, you have to react and do something please. Thanks in advance.

sbidy commented 2 years ago

Thank you for the feedback on that topic. It is true that with the automated detection of the bulb, the workaround to define a "bulb" as a switch is gone.

An implementation of the switch functionality is not that complicated and an automated detection is via device name (e.g. ESP10_SOCKET_01) possible.

But as I mentioned (multiple times) the current focus of the development is to bring it into the core of HASS. And the finale merge happened today after a lot of work and testing (thanks to @bdraco and the HASS community) in the past weeks. Additionally, the integration was renamed to "WiZ" to provide a single integration for all devices types, including the plugs.

So, after a stable and merged version of the integration (the initial PR to HASS core was opened in January 2021), one of the next things will be the smart plug support for the integration. Please stay tuned and look out for updates in this repository.

But if you want the support faster, please feel free to fork this (or the pywizlight library) repository and add it. A PR is welcome to push back your implementation and contribute to the whole community.

Overall, this project is an open source project under the MIT license there is in general no support or warranty. The community, contributors, and I do our best to help as much we can in our free time.

I understand your dissatisfaction, but please be considerate to the hard work of the open source community.

bdraco commented 2 years ago

I added support for these on the switch platform since the plugs I had tested with were showing up as lights 🙈

https://github.com/home-assistant/core/blob/dev/homeassistant/components/wiz/switch.py

The detection of the device type should likely be moved into pywizlight as its not as clean as I would have liked.

sbidy commented 2 years ago

"as its not as clean as I would have liked."... Jep ... True story. It should completely reworked and published under a "pywiz" lib. It was also mentioned here that the API is not that comfortable, https://github.com/sbidy/pywizlight/issues/101.

I'm not sure how fast I can provide a new lib with some cleanup and simplification. Maybe a first "quick & dirty" extension to the existing lib can be a first step.

bdraco commented 2 years ago

For "quick & dirty" adding a BulbClass of SOCKET would do the trick. We could actually drop some code from the Home Assistant side as well. Honestly, there isn't much value in refactoring to change the name of BulbClass though since users don't see it.

https://github.com/sbidy/pywizlight/blob/master/pywizlight/bulblibrary.py#L48 SOCKET = "Socket"

bdraco commented 2 years ago

https://github.com/sbidy/pywizlight/pull/102