Allow "idle" media players to be switched of in entity row (#8155)

This commit is contained in:
Philip Allgaier 2021-01-14 11:35:31 +01:00 committed by GitHub
parent 1aab656705
commit b565a8b8f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -249,9 +249,7 @@ class HuiMediaPlayerEntityRow extends LitElement implements LovelaceRow {
this.hass!.callService(
"media_player",
stateObj.state === "off" || stateObj.state === "idle"
? "turn_on"
: "turn_off",
stateObj.state === "off" ? "turn_on" : "turn_off",
{
entity_id: this._config!.entity,
}