Skip to content

Custom-ui optimized by GPT

Pre-release
Pre-release
Compare
Choose a tag to compare
@Mariusthvdb Mariusthvdb released this 27 Dec 15:29
· 53 commits to master since this release
0d4cfde

Release Notes for Custom-ui 20221227-GPT

ChatbotGPT even generated the release notes ....

Changes

Adapted the code for compatibility with Home Assistant 2022.4 and higher.
Optimized the installStatesHook function by removing the Object.values call and iterating over the obj.states object directly.
Changed the updateMoreInfo function to clear the interval after the first successful iteration, instead of after two iterations.

Known Issues

The updateMoreInfo function still uses a setInterval loop to wait for the necessary DOM elements to be available. It would be better to use a more efficient mechanism, such as a Promise or MutationObserver, to wait for the elements to appear.
The updateMoreInfo function uses several nested querySelector calls and getElementsByClassName calls to access nested DOM elements. It would be more efficient to use a single querySelector call with a compound selector to access these elements.
The updateMoreInfo function uses innerText to get the text content of DOM elements, which can be slow and may not work correctly with some internationalized text. It would be better to use the textContent property to get the text content of DOM elements.

What's Changed

Full Changelog: 2022111...2022121