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

Replace all spaces with underscores when searching for sensor #60

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

hugo-vrijswijk
Copy link
Contributor

@hugo-vrijswijk hugo-vrijswijk commented Jan 8, 2025

Names with multiple spaces would only get 1 replacement underscore. For example "Dick van Dyke" would be replaced with "dick_van dyke" which is never a valid sensor

@Nerwyn
Copy link
Owner

Nerwyn commented Jan 8, 2025

Nice catch! One thing though. While replaceAll is supported by all modern browsers, it doesn't work on a lot of older devices that Home Assistant users use as displays like old Android tablets and iPads. replace is supported by everything and can be done globally using regex. If you instead replace the first argument with a regex, it'll have much wider browser support. Like replace(/ /g, '_').

@Nerwyn
Copy link
Owner

Nerwyn commented Jan 8, 2025

One last thing @hugo-vrijswijk! Change the target branch to dev. That way I can do some final confirmations before merging to main and making a patch release.

@hugo-vrijswijk hugo-vrijswijk changed the base branch from main to dev January 8, 2025 18:06
@hugo-vrijswijk
Copy link
Contributor Author

hugo-vrijswijk commented Jan 8, 2025

One last thing @hugo-vrijswijk! Change the target branch to dev. That way I can do some final confirmations before merging to main and making a patch release.

Done 👍. Fyi you can also change that

@Nerwyn Nerwyn merged commit 32613e5 into Nerwyn:dev Jan 8, 2025
1 check passed
@Nerwyn
Copy link
Owner

Nerwyn commented Jan 8, 2025

Released 3.0.3.

Although with JS module changes, the new release doesn't actually have any changes that will be downloaded via HACS and simply exists to inform users of changes to the JS module. Users who downloaded the file locally will have to manually download the module again, but CDN users will receive the latest version since I cleared jsDelivr's cache for this file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants