Skip to content

Don't show toggle always on more info#11640

Merged
bramkragten merged 2 commits intodevfrom
Don't-show-toggle-on-more-info-group-always
Feb 14, 2022
Merged

Don't show toggle always on more info#11640
bramkragten merged 2 commits intodevfrom
Don't-show-toggle-on-more-info-group-always

Conversation

@zsarnett
Copy link
Copy Markdown
Contributor

Breaking change

Proposed change

image
image

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

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:

for (const entity of stateObj.attributes.entity_id) {
const d = computeStateDomain(hass.states[entity]);
if (canToggleDomain(hass, d)) {
return stateObj.state === "on" || stateObj.state === "off";
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.

should this be the state of entity?

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.

No its should be the main group
This basically checks if toggle is possible and then it should use the group state for the on and off
otherwise it would be different that the previous functionality when toggle is present

if (domain === "group") {
return stateObj.state === "on" || stateObj.state === "off";
for (const entity of stateObj.attributes.entity_id) {
const d = computeStateDomain(hass.states[entity]);
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.

hass.states[entity] can be undefined

@bramkragten bramkragten merged commit 63c9b3f into dev Feb 14, 2022
@bramkragten bramkragten deleted the Don't-show-toggle-on-more-info-group-always branch February 14, 2022 15:21
@github-actions github-actions bot locked and limited conversation to collaborators Feb 15, 2022
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.

group more-info shows toggle on group with binary entities only

3 participants