Skip to content

LIFX: small error corrections#7446

Merged
robbiet480 merged 7 commits into
home-assistant:devfrom
amelchio:lifx-misc
May 5, 2017
Merged

LIFX: small error corrections#7446
robbiet480 merged 7 commits into
home-assistant:devfrom
amelchio:lifx-misc

Conversation

@amelchio
Copy link
Copy Markdown
Contributor

@amelchio amelchio commented May 4, 2017

Description:

Several minor fixes and cleanups. Details in each commit message.

Checklist:

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

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • New dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.

amelchio added 7 commits May 4, 2017 00:21
This clears the internal cache in case polling picked up the state as set by
an effect.

For example, aborting an effect by selecting a new brightness could keep a
color set by the effect.
State restoration takes up to a second because bulbs can be slow to react.
During this time an effect could keep running, overwriting the state that we
were trying to restore.

Now the effect forgets the light immediately and it thus avoids further
changes while the restored state settles.
This does not really matter because the colorloop uses saturated colors
(without much white). Anyway, just copy the 3500K that the LIFX app uses.
It's a reasonable default for several light effects.
This update silences some warnings (aiolifx/aiolifx#7).
Forcing a refresh will log a warning if the periodic async_update happens
to be running already.

So let's do the refresh locally and remove the force_refresh.
Recent aiolifx allow sending messages to unregistered devices (as a
no-op). This is handy because bulbs can disappear anytime we yield and
constantly testing for availability is both error-prone and annoying.

So keep the aiolifx device around until a new one registers on the same
mac_addr.
@mention-bot
Copy link
Copy Markdown

@amelchio, thanks for your PR! By analyzing the history of the files in this pull request, we identified @fabaff, @nugget and @balloob to be potential reviewers.

@robbiet480 robbiet480 merged commit 2f68612 into home-assistant:dev May 5, 2017
@balloob balloob added this to the 0.44 milestone May 5, 2017
@balloob
Copy link
Copy Markdown
Member

balloob commented May 5, 2017

Cherry-picked for 0.44.

@home-assistant home-assistant locked and limited conversation to collaborators Aug 12, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants