Skip to content

Alarm Card Editor to HA Form#11760

Merged
bramkragten merged 2 commits intodevfrom
alarm-card-editors
Feb 22, 2022
Merged

Alarm Card Editor to HA Form#11760
bramkragten merged 2 commits intodevfrom
alarm-card-editors

Conversation

@zsarnett
Copy link
Copy Markdown
Contributor

Breaking change

Proposed change

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:

Comment on lines +92 to +97
Object.keys(config).forEach(
(k) =>
(config[k] === "" ||
(Array.isArray(config[k]) && config[k].length === 0)) &&
delete config[k]
);
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.

This code is pretty unreadable.

Suggested change
Object.keys(config).forEach(
(k) =>
(config[k] === "" ||
(Array.isArray(config[k]) && config[k].length === 0)) &&
delete config[k]
);
for (const key of Object.keys(config)) {
if (config[k] === "" ||
(Array.isArray(config[k]) && config[k].length === 0))) {
delete config[k]
}
};

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.

Also what fields can set empty string? in ha-form things can be undefined when not set.

balloob
balloob previously approved these changes Feb 21, 2022
@bramkragten bramkragten merged commit 15d1b8b into dev Feb 22, 2022
@bramkragten bramkragten deleted the alarm-card-editors branch February 22, 2022 10:00
@github-actions github-actions bot locked and limited conversation to collaborators Feb 23, 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.

4 participants