frontend
frontend copied to clipboard
Fix localize key type errors for states
Proposed change
The goal here is to remove the 3 localize exceptions for state*:
- Replace instances of
UNAVAILABLE_STATES.includeswith the new type predicate functionisUnavailableState. This is the bulk of the files touched so it might help to review this commit separately as all changes are identical. - Use new literal types for climate attributes. This exposed a bug where the fan only action was missing from the tile card badge so I added it (cc @piitaya).
- Use a literal type for humidifier entity state, and cast an instance for the entity row to use the humidifier entity type.
- Use literal types where the state label is truncated for badges.
Type of change
- [ ] Dependency upgrade
- [x] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (thank you!)
- [ ] Breaking change (fix/feature causing existing functionality to break)
- [x] 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
- [x] The code change is tested and works locally.
- [x] There is no commented out code in this PR.
- [ ] Tests have been added to verify that the new code works.
I used the satisfies operator, so the prettier check will pass once #14694 is merged.