Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModernForms fan: light flashes old brightness value when coming on #59655

Closed
eliwind opened this issue Nov 13, 2021 · 3 comments
Closed

ModernForms fan: light flashes old brightness value when coming on #59655

eliwind opened this issue Nov 13, 2021 · 3 comments

Comments

@eliwind
Copy link

eliwind commented Nov 13, 2021

The problem

The ModernForms fan light internally has a notion of "brightness" that it retains whether on or off; if you toggle it on, it comes on to the brightness setting from the last time it was on. This is good.

However, if you turn it on while specifying a brightness (e.g. using the light.turn_on service and providing a brightness value; or sliding the brightness slider to a non-zero value while the light is off in the lovelace UI), then the light should come on at the newly selected brightness value. But in fact, it firstomes on initially at its old brightness and then quickly changes to the newly-selected brightness, appearing to flash.

It seems that the way to make this work as expected is rather than sending a single request to the light changing both brightness and "on" state in one shot, to first set the brightness to the new value, and only after that has adjusted, to send a separate request to turn the light on.

What version of Home Assistant Core has the issue?

core-2021.11.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Modern Forms

Link to integration documentation on our website

https://www.home-assistant.io/integrations/modern_forms/

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

This line of code seems to be the source of the problem:

await self.coordinator.modern_forms.light(**data)

While it seems like a reasonable request of the fan to both turn on and set brightness in one shot, empirically the result is that the light turns on at its previous brightness level first and then adjusts the brightness after. Doing two separate requests seems to make it work here.

@probot-home-assistant
Copy link

modern_forms documentation
modern_forms source
(message by IssueLinks)

@probot-home-assistant
Copy link

Hey there @wonderslug, mind taking a look at this issue as it has been labeled with an integration (modern_forms) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

@wonderslug
Copy link
Contributor

Howdy, Yeah seeing this. It probably should be adjusted at the library level, not as much at the HA level. Ive setup an issue wonderslug/aiomodernforms#99 and will see if I can make the adjustments soon.

@github-actions github-actions bot added the stale label Dec 15, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jan 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants