-
Notifications
You must be signed in to change notification settings - Fork 21
Add light color state (#1) #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
* update with async * ajustement * method to set color * update version * update websocket * comment adjustment * comment adjustment * update version
| async def setColorRGB(self, r: int, g: int, b: int, *, rate: int | None = None): | ||
| """RGB 0..255 -> xy, mode=0 (full color).""" | ||
| x, y = self._rgb_to_xy(r, g, b) | ||
| await self.setColorXY(x, y, rate=rate, mode=0) | ||
|
|
||
| async def setColorHex(self, hex_color: str, *, rate: int | None = None): | ||
| """HEX (#RRGGBB/#RGB/RRGGBB/RGB) -> xy, mode=0 (full color).""" | ||
| r, g, b = self._hex_to_rgb(hex_color) | ||
| await self.setColorRGB(r, g, b, rate=rate) | ||
|
|
||
| async def setColorTemperature(self, kelvin: int, *, rate: int | None = None): | ||
| """Kelvin -> xy, mode=1 (CCT).""" | ||
| x, y = self._cct_to_xy(kelvin) | ||
| await self.setColorXY(x, y, rate=rate, mode=1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If Control4 only supports XY color, we should not try to implement our own color conversions for RGB, hex, CCT, etc. inside the pyControl4 library. Color conversion should be left to the clients (like Home Assistant). Please remove all the extra color utils as well.
|
|
||
| def remove_item_callback(self, item_id, callback=None): | ||
| """Unregister callback(s) for an item. | ||
| MODIFIED: Supports selective or complete removal. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove all MODIFIED words from comments (leftovers from AI?)
| import aiohttp | ||
|
|
||
| ip = "192.168.1.25" | ||
| ip = "192.168.2.40" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove all changes to test.py
update with async
method to set color
update websocket
update version