mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 16:17:20 +00:00
Use _attr_state in harman kardon avr media player (#82826)
This commit is contained in:
parent
5be36912b2
commit
9ea8e0a7ca
@ -66,18 +66,17 @@ class HkAvrDevice(MediaPlayerEntity):
|
|||||||
|
|
||||||
self._source_list = avr.sources
|
self._source_list = avr.sources
|
||||||
|
|
||||||
self._state = None
|
|
||||||
self._muted = avr.muted
|
self._muted = avr.muted
|
||||||
self._current_source = avr.current_source
|
self._current_source = avr.current_source
|
||||||
|
|
||||||
def update(self) -> None:
|
def update(self) -> None:
|
||||||
"""Update the state of this media_player."""
|
"""Update the state of this media_player."""
|
||||||
if self._avr.is_on():
|
if self._avr.is_on():
|
||||||
self._state = MediaPlayerState.ON
|
self._attr_state = MediaPlayerState.ON
|
||||||
elif self._avr.is_off():
|
elif self._avr.is_off():
|
||||||
self._state = MediaPlayerState.OFF
|
self._attr_state = MediaPlayerState.OFF
|
||||||
else:
|
else:
|
||||||
self._state = None
|
self._attr_state = None
|
||||||
|
|
||||||
self._muted = self._avr.muted
|
self._muted = self._avr.muted
|
||||||
self._current_source = self._avr.current_source
|
self._current_source = self._avr.current_source
|
||||||
@ -87,11 +86,6 @@ class HkAvrDevice(MediaPlayerEntity):
|
|||||||
"""Return the name of the device."""
|
"""Return the name of the device."""
|
||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
@property
|
|
||||||
def state(self):
|
|
||||||
"""Return the state of the device."""
|
|
||||||
return self._state
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_volume_muted(self):
|
def is_volume_muted(self):
|
||||||
"""Muted status not available."""
|
"""Muted status not available."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user