koying / openrgb_ha

OpenRGB integration for Home Assistant
110 stars 16 forks source link

Added support for individual LED control #8

Closed FeikoJoosten closed 3 years ago

FeikoJoosten commented 3 years ago

I've added support for individual LED controls. I've also tried to fix https://github.com/koying/openrgb_ha/issues/7 but unfortunately I was unsuccessful with that 😞

I'm am quite certain I've fixed most issues related to unique_id generation though. And I believe I wasn't properly reloading the integration or something causing Homeassistant to re-create all entities hence another complain about the unique ids. But imo that case should be solved as well. So I didn't 100% fix it.

koying commented 3 years ago

Thanks. I've done a preliminary test on my setup, and I have some remarks: 1) There is no entity to set a single global light as it was before, correct? To keep the functionality and to avoid a breaking change, please keep the global ones as before, ideally with the same unique id, and create new individual entities for single LEDs with, e.g., "led" in their names 1) Please disable the individual LED entities by default, to avoid entity clutter for people not interested in the functionality 1) I have 2 similar corsair RGB DIMM's. Only one is picked up, apparently.

PS: metadata.serial is empty for the corsair DIMMs, which explains why the second one is ignored.

FeikoJoosten commented 3 years ago

Thanks for the feedback.

  1. I completely forgot about the past functionality. You're correct and I'll try and see if I can set it up so this is still supported.
  2. Yep, was thinking that as well now the global entity will be a thing again.
  3. I saw your ps note. I'll add a check to see if the serial is empty, if so I'll revert back to the old ID generation. I do believe keeping the serial method is a good approach as it is less likely to change.
FeikoJoosten commented 3 years ago

Alright, I believe I've fixed the issues you mentioned. Let me know if there is still anything wrong.

PS: I'm a Python noob, so please feel free to fix any of my mistakes where needed.

HydrelioxGitHub commented 3 years ago

Thanks all for you work and your time with this.

koying commented 3 years ago

Thanks a lot for the changes ! I created a PR vs. your fork for some additional tweakings: https://github.com/FeikoJoosten/openrgb_ha/pull/1

koying commented 3 years ago

Thanks mucho :)