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

Don't show toggle always on more info #11640

Merged
merged 2 commits into from Feb 14, 2022

Conversation

zsarnett
Copy link
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
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
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
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