Skip to content

Fix confused brightness of xiaomi_aqara gateway light#15314

Merged
Danielhiversen merged 1 commit intohome-assistant:devfrom
amelchio:xiaomi_aqara-light-brightness
Jul 10, 2018
Merged

Fix confused brightness of xiaomi_aqara gateway light#15314
Danielhiversen merged 1 commit intohome-assistant:devfrom
amelchio:xiaomi_aqara-light-brightness

Conversation

@amelchio
Copy link
Copy Markdown
Contributor

@amelchio amelchio commented Jul 5, 2018

Description:

There was a mixup of scales 0-100 (Xiaomi) and 0-255 (Home Assistant). This caused the brightness to change when setting a new hs_color.

Now self._brightness is always 0-100.

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox.

If the code communicates with devices, web services, or third-party tools:

  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New or updated dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.


@property
def brightness(self):
"""Return the brightness of this light between 0..255."""
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the doc string too

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, the property self.brightness is actually 0..255.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, sorry

@Danielhiversen Danielhiversen merged commit f32098a into home-assistant:dev Jul 10, 2018
@ghost ghost removed the in progress label Jul 10, 2018
awarecan pushed a commit to awarecan/home-assistant that referenced this pull request Jul 16, 2018
@balloob balloob mentioned this pull request Jul 20, 2018
michaeldavie pushed a commit to michaeldavie/home-assistant that referenced this pull request Jul 31, 2018
girlpunk pushed a commit to girlpunk/home-assistant that referenced this pull request Sep 4, 2018
@home-assistant home-assistant locked and limited conversation to collaborators Dec 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants