WebThingsIO / yeelight-adapter

Yeelight device adapter for WebThings Gateway
Mozilla Public License 2.0
7 stars 4 forks source link

Yeelight v1 color mode #2

Closed jlsalvador closed 5 years ago

jlsalvador commented 5 years ago

Hi! Can you add or mode == 2 too? Thanks in advance.

https://github.com/mozilla-iot/yeelight-adapter/blob/7dfb6afaaf1a612f4c5cd5dbbd4288e7353eba0d/pkg/yeelight_device.py#L151

Dump from yeelight.py:

{'ip': '192.168.2.15',
  'port': 55443,
  'capabilities': {'id': '0x0',
   'model': 'color',
   'fw_ver': '70',
   'support': 'get_prop set_default set_power toggle set_bright start_cf stop_cf set_scene cron_add cron_get cron_del set_ct_abx set_rgb set_hsv set_adjust adjust_bright adjust_ct adjust_color set_music set_name',
   'power': 'off',
   'bright': '100',
   'color_mode': '2',
   'ct': '3968',
   'rgb': '14267193',
   'hue': '46',
   'sat': '73',
   'name': ''}}]
jlsalvador commented 5 years ago

Even with this change, I can't change the bright using the Mozilla IoT Gateway. I can setup the bright using yeecli or the library directly.

To enable bright, just remove and not self.is_color() from https://github.com/mozilla-iot/yeelight-adapter/blob/master/pkg/yeelight_device.py#L68

mrstegeman commented 5 years ago

color_mode 2 indicates that the bulb is currently in color temperature mode.

A long time ago, our team decided that for RGB bulbs, we would not expose color temperature or brightness properties, because both of those can be described by an RGB color. To change the brightness, there should be a brightness slider in your color picker.

LasseRosenow commented 4 years ago

Since in 0.12 "ColorModeProperty" was added can we please think about this again?

ColorModeProperty is now supported for light bulbs which can set both RGB color and white temperature.

So I think clearly the "team" wants to support this special use case, which is not really that special but rather pretty common in my opinion.

mrstegeman commented 4 years ago

Yes, I'll be merging #9 soon.