From 77b609e6fda82605a9b29970d43d82f7bc470f8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Nyi=CC=81ri?= Date: Sat, 1 May 2021 17:45:15 +0200 Subject: [PATCH] Fix: Entity now works --- www/content-card-example.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/www/content-card-example.js b/www/content-card-example.js index 6c7c03b..a132454 100644 --- a/www/content-card-example.js +++ b/www/content-card-example.js @@ -62,6 +62,7 @@ class ContentCardExample extends HTMLElement { thumbSmall + "'); background-repeat: no-repeat; background-size: contain;"; movieElem.innerHTML = data.title; + const _this = this; movieElem.addEventListener("click", function (event) { var keyParts = data.key.split("/"); var movieID = keyParts[keyParts.length - 1]; @@ -71,7 +72,7 @@ class ContentCardExample extends HTMLElement { "/com.plexapp.plugins.library/library/metadata/" + movieID + "'"; - var entity_id = this.config.entity_id; + var entity_id = _this.config.entity_id; hass.callService("androidtv", "adb_command", { entity_id, command,