Skip to content

Commit

Permalink
Replace non-existing MediaPlayerState.UNAVAILABLE with STATE.UNAVAILA…
Browse files Browse the repository at this point in the history
…BLE (#1) (#81)

MediaPlayerState.UNAVAILABLE state does not exist in enum hence replacing with STATE.UNAVAILABLE.

https://github.com/home-assistant/core/blob/59a01fcf9c42a233ecaa92c6328116128569881c/homeassistant/components/media_player/const.py#L42
  • Loading branch information
dynasticorpheus committed Jan 3, 2024
1 parent 1f91d3e commit a024b57
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion custom_components/lghorizon/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import datetime as dt
import time
import voluptuous as vol
from homeassistant.const import STATE_UNAVAILABLE
from homeassistant.helpers import config_validation as cv, entity_platform
from homeassistant.components.media_player import (
MediaPlayerEntity,
Expand Down Expand Up @@ -159,7 +160,7 @@ def state(self):
return MediaPlayerState.PLAYING
if self._box.state == ONLINE_STANDBY:
return MediaPlayerState.OFF
return MediaPlayerState.UNAVAILABLE
return STATE_UNAVAILABLE

@property
def media_content_type(self):
Expand Down

0 comments on commit a024b57

Please sign in to comment.