al-one / hass-miio-yeelink

Xiaomi Miio Yeelink/Yeelight devices for Home Assistant
174 stars 29 forks source link

yeelink.light.bslamp2 doesn't respect brightness set in scene #62

Closed sviperz closed 2 years ago

sviperz commented 2 years ago

yeelink.light.bslamp2 behaves oddly when brightness is set via scene. I set brightness as 50% in scene, but when the scene is activated the lamp brightness is 49% for some reason. The brightness can be easily set to 50% manually though.

This is the state that is saved in scenes.yaml and can be achieved manually:

min_mireds: 154
max_mireds: 588
effect_list:
  - Color
  - Day
supported_color_modes:
  - brightness
  - color_temp
  - hs
  - onoff
color_mode: hs
brightness: 127
hs_color:
  - 15.059
  - 100
rgb_color:
  - 255
  - 64
  - 0
xy_color:
  - 0.676
  - 0.32
effect: Color
model: yeelink.light.bslamp2
lan_ip: 192.168.1.149
mac_address: 7C:49:EB:65:4F:E4
entity_class: MiotLightEntity
home_room: Cave Living Room
miot_type: urn:miot-spec-v2:device:light:0000A001:yeelink-bslamp2:1
light.on: true
light.brightness: 50
light.color_temperature: 1701
light.color: 16728064
light.mode: 1
light.saturability: 100
state_updater: lan
friendly_name: Lamp Light
supported_features: 55

and this is the state after scene activation:

min_mireds: 154
max_mireds: 588
effect_list:
  - Color
  - Day
supported_color_modes:
  - brightness
  - color_temp
  - hs
  - onoff
color_mode: hs
brightness: 125
hs_color:
  - 14.824
  - 100
rgb_color:
  - 255
  - 63
  - 0
xy_color:
  - 0.677
  - 0.319
effect: Color
model: yeelink.light.bslamp2
lan_ip: 192.168.1.149
mac_address: 7C:49:EB:65:4F:E4
entity_class: MiotLightEntity
home_room: Cave Living Room
miot_type: urn:miot-spec-v2:device:light:0000A001:yeelink-bslamp2:1
light.on: true
light.brightness: 49
light.color_temperature: 1701
light.color: 16727808
light.mode: 1
light.saturability: 100
state_updater: lan
friendly_name: Lamp Light
supported_features: 55

Differences are only in brightness and light.brightness.

sviperz commented 2 years ago

I should have created this in Xiaomi Miot For HomeAssistant instead. Sorry for confusion.