Skip to content

Commit

Permalink
Update tv-card.js
Browse files Browse the repository at this point in the history
  • Loading branch information
TechHome authored Mar 21, 2020
1 parent 5266952 commit 7415e3a
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions tv-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,13 +285,16 @@ class TVCardServices extends LitElement {
: null
);
} else {
let remote = this._config.remote
? this._config.remote
: "remote." + this._config.entity.split(".")[1];
this.hass.callService("remote", "send_command", {
entity_id: remote,
command: e.currentTarget.action
});
const [domain, service] = this._config[
e.currentTarget.action
].service.split(".", 2);
this.hass.callService(
domain,
service,
this._config[e.currentTarget.action].service_data
? this._config[e.currentTarget.action].service_data
: null
);
}
}

Expand Down

0 comments on commit 7415e3a

Please sign in to comment.