Skip to content

Use supported_color_modes to determine what UI elements to show#8961

Merged
balloob merged 16 commits intodevfrom
color_mode
Apr 27, 2021
Merged

Use supported_color_modes to determine what UI elements to show#8961
balloob merged 16 commits intodevfrom
color_mode

Conversation

@bramkragten
Copy link
Copy Markdown
Member

@bramkragten bramkragten commented Apr 21, 2021

Proposed change

image

TODO: CLEANUP!

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@bramkragten bramkragten changed the title Use supported_color_modes to determine what to UI to show Use supported_color_modes to determine what UI elements to show Apr 21, 2021
@spacegaier
Copy link
Copy Markdown
Member

Related #7956 and the linked issues/discussions. What do we do with those points?

@thecode
Copy link
Copy Markdown
Member

thecode commented Apr 26, 2021

Hi @bramkragten with this change how will the frontend show the white brightness? will it use 0-255 or 0-100%?
IMO all sliders should be in the range 0-100%.

The bellow are just suggestions or for better understanding, not mandatory:

  • Does the UI reflect the mode of the entity? (Color mode or Color temperature mode)?
  • When a user click on COLOR or TEMPERATURE will it sends an event for this?

Currently Shelly integration has two modes of operation for color bulbs/devices:

  • When you change something in the RGB color picker or the white brightness we sends a mode change command to the bulb to switch to color mode and sends the updated RGB/W values
  • When you change the color temperature value we sends a mode change for the bulb to switch to white mode (in Shelly white mode is a mode when you control only color temperature and brightness, not to mix with color mode which has RGBW and brightness)

As far as I know Deconz integration works in a similar way.

I am going to make a PR to adjust Shelly to support this changes.

@spacegaier
Copy link
Copy Markdown
Member

I had a similar thought a few days ago: For a Kelvin based temperature value (from cold to warm) currently I get a weird value shown on the slider. It is neither from 0...100% nor is it Kelvin (2600K to 6000K in my case as defined in the used integration).

image

Haven't investigated yet, but might be related to this PR.

@bramkragten
Copy link
Copy Markdown
Member Author

I had a similar thought a few days ago: For a Kelvin based temperature value (from cold to warm) currently I get a weird value shown on the slider. It is neither from 0...100% nor is it Kelvin (2600K to 6000K in my case as defined in the used integration).

image

Haven't investigated yet, but might be related to this PR.

It is mired, what is used inside HA https://en.wikipedia.org/wiki/Mired

I personally would prefer Kelvin, as it is more widely used.

@bramkragten
Copy link
Copy Markdown
Member Author

Hi @bramkragten with this change how will the frontend show the white brightness? will it use 0-255 or 0-100%?
IMO all sliders should be in the range 0-100%.

It currently is 0-225, but yeah I kinda agree.

The bellow are just suggestions or for better understanding, not mandatory:

  • Does the UI reflect the mode of the entity? (Color mode or Color temperature mode)?

Yes

  • When a user click on COLOR or TEMPERATURE will it sends an event for this?

If the user chooses a color or a color temperature, that will be sent to the backend.

Currently Shelly integration has two modes of operation for color bulbs/devices:

  • When you change something in the RGB color picker or the white brightness we sends a mode change command to the bulb to switch to color mode and sends the updated RGB/W values
  • When you change the color temperature value we sends a mode change for the bulb to switch to white mode (in Shelly white mode is a mode when you control only color temperature and brightness, not to mix with color mode which has RGBW and brightness)

This will stay the same.

As far as I know Deconz integration works in a similar way.

I am going to make a PR to adjust Shelly to support this changes.

👍

Comment thread gallery/src/demos/demo-more-info-light.ts
Comment thread src/components/entity/state-badge.ts Outdated
Comment thread src/components/ha-button-toggle-group.ts Outdated
// use these properties to update the state via attributes
desiredRgbColor: {
type: Object,
observer: "applyRgbColor",
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.

observer 😱

Comment thread src/components/ha-color-picker.js Outdated
@balloob balloob merged commit 36586b7 into dev Apr 27, 2021
@balloob balloob deleted the color_mode branch April 27, 2021 17:43
@balloob balloob mentioned this pull request Apr 28, 2021
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 28, 2021
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