Skip to content

Commit

Permalink
fix more-info with 2023.9 (#100)
Browse files Browse the repository at this point in the history
* Update update_more_info.js

to be compatible with 2023.9

thanks to @elchininet from the amazing Kiosk-mode custom card for fixing this in NemesisRE/kiosk-mode#98 (reply in thread)

* Update update_more_info.js
  • Loading branch information
Mariusthvdb authored Sep 6, 2023
1 parent 949bb5a commit 7ee9d36
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions update_more_info.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const Name = "Update more-info";
const Version = "20230628";
const Version = "20230906";
const Description = "standalone";
const Url = "https://github.com/Mariusthvdb/custom-ui";

Expand Down Expand Up @@ -63,10 +63,15 @@ function updateMoreInfo(ev) {
let e;
for (const node of t) {
const o = node.getElementsByClassName("key")[0];
// make compatible for both 2023.8 and 2023.9
if (o.innerText.toLowerCase().trim() == "hide attributes") {
e = o.parentNode
.getElementsByClassName("value")[0]
.innerText.split(",")
const valueContainer = o.parentNode.getElementsByClassName("value")[0];
const haAttributeValue = valueContainer.querySelector('ha-attribute-value');
const text = haAttributeValue
? haAttributeValue.shadowRoot.textContent
: valueContainer.innerText;
e = text
.split(",")
.map((item) => item.replace("_", " ").trim());
e.push("hide attributes");
}
Expand Down

0 comments on commit 7ee9d36

Please sign in to comment.