wyze-sdk
wyze-sdk copied to clipboard
Any way to expose whether a mesh bulb is currently displaying color or white?
I haven't been able to find anything in the provided bulb info that indicates whether a mesh bulb is currently in color mode or white mode. Wondering if there's anything the bulb can give you that would allow you to expose it via the API? It's something that would be useful to know for my application, if it's possible to do.
Hi John,
The mesh/color bulb has 2 fields related to color: temperature and color. The logic in the Wyze app appears to toggle whether the bulb is in white or color mode based on whether the temperature property is set and non-zero. Give that a shot?
On Wed, Sep 1, 2021 at 7:09 PM John Torgerson @.***> wrote:
I haven't been able to find anything in the provided bulb info that indicates whether a mesh bulb is currently in color mode or white mode. Wondering if there's anything the bulb can give you that would allow you to expose it via the API? It's something that would be useful to know for my application, if it's possible to do.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/shauntarves/wyze-sdk/issues/41, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEDBMCN6IRMBNFSERMZ6VDT72XDLANCNFSM5DHTC6AQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
Hey, thanks for getting back to me, sorry about the delay responding to you. The python API seems to report the last used temperature and the last used color setting for each bulb regardless of which mode it is currently in, so it seems there's no way (currently) to tell which. Is it perhaps the case that the bulb itself is updating/erasing the temperature value when put into color mode but the API just isn't picking up on it somehow? Although I'm not sure how it would remember what the last value was if it isn't getting the info from the bulb every time...
This has been added as a new field in Bulb
called control_mode
(https://github.com/shauntarves/wyze-sdk/blob/master/wyze_sdk/models/devices/lights.py#L159) and is backed by a new enum LightControlMode
(https://github.com/shauntarves/wyze-sdk/blob/master/wyze_sdk/models/devices/lights.py#L11-L31)