parent
650aae49fe
commit
fd05d949cc
4 changed files with 5 additions and 21 deletions
|
@ -61,7 +61,7 @@ class DemoBinarySensor(BinarySensorEntity):
|
|||
self._unique_id = unique_id
|
||||
self._attr_name = name
|
||||
self._state = state
|
||||
self._sensor_type = device_class
|
||||
self._attr_device_class = device_class
|
||||
|
||||
@property
|
||||
def device_info(self) -> DeviceInfo:
|
||||
|
@ -79,11 +79,6 @@ class DemoBinarySensor(BinarySensorEntity):
|
|||
"""Return the unique id."""
|
||||
return self._unique_id
|
||||
|
||||
@property
|
||||
def device_class(self) -> BinarySensorDeviceClass:
|
||||
"""Return the class of this sensor."""
|
||||
return self._sensor_type
|
||||
|
||||
@property
|
||||
def is_on(self) -> bool:
|
||||
"""Return true if the binary sensor is on."""
|
||||
|
|
|
@ -85,7 +85,7 @@ class DemoCover(CoverEntity):
|
|||
self._unique_id = unique_id
|
||||
self._attr_name = name
|
||||
self._position = position
|
||||
self._device_class = device_class
|
||||
self._attr_device_class = device_class
|
||||
self._supported_features = supported_features
|
||||
self._set_position: int | None = None
|
||||
self._set_tilt_position: int | None = None
|
||||
|
@ -142,11 +142,6 @@ class DemoCover(CoverEntity):
|
|||
"""Return if the cover is opening."""
|
||||
return self._is_opening
|
||||
|
||||
@property
|
||||
def device_class(self) -> CoverDeviceClass | None:
|
||||
"""Return the class of this device, from component DEVICE_CLASSES."""
|
||||
return self._device_class
|
||||
|
||||
@property
|
||||
def supported_features(self) -> int:
|
||||
"""Flag supported features."""
|
||||
|
|
|
@ -120,7 +120,7 @@ class AbstractDemoPlayer(MediaPlayerEntity):
|
|||
self._shuffle = False
|
||||
self._sound_mode_list = SOUND_MODE_LIST
|
||||
self._sound_mode = DEFAULT_SOUND_MODE
|
||||
self._device_class = device_class
|
||||
self._attr_device_class = device_class
|
||||
|
||||
@property
|
||||
def state(self) -> str:
|
||||
|
@ -152,11 +152,6 @@ class AbstractDemoPlayer(MediaPlayerEntity):
|
|||
"""Return a list of available sound modes."""
|
||||
return self._sound_mode_list
|
||||
|
||||
@property
|
||||
def device_class(self) -> MediaPlayerDeviceClass | None:
|
||||
"""Return the device class of the media player."""
|
||||
return self._device_class
|
||||
|
||||
def turn_on(self) -> None:
|
||||
"""Turn the media player on."""
|
||||
self._player_state = MediaPlayerState.PLAYING
|
||||
|
@ -427,12 +422,11 @@ class DemoTVShowPlayer(AbstractDemoPlayer):
|
|||
|
||||
# We only implement the methods that we support
|
||||
|
||||
_attr_device_class = MediaPlayerDeviceClass.TV
|
||||
_attr_media_content_type = MediaType.TVSHOW
|
||||
|
||||
def __init__(self) -> None:
|
||||
"""Initialize the demo device."""
|
||||
super().__init__("Lounge room")
|
||||
super().__init__("Lounge room", MediaPlayerDeviceClass.TV)
|
||||
self._cur_episode = 1
|
||||
self._episode_count = 13
|
||||
self._source = "dvd"
|
||||
|
|
|
@ -221,7 +221,7 @@ DEMO_DEVICES = [
|
|||
"action.devices.traits.TransportControl",
|
||||
"action.devices.traits.MediaState",
|
||||
],
|
||||
"type": "action.devices.types.SETTOP",
|
||||
"type": "action.devices.types.TV",
|
||||
"willReportState": False,
|
||||
},
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue