diff --git a/homeassistant/components/demo/binary_sensor.py b/homeassistant/components/demo/binary_sensor.py index 584c0cf88f1..ee718e85cc0 100644 --- a/homeassistant/components/demo/binary_sensor.py +++ b/homeassistant/components/demo/binary_sensor.py @@ -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.""" diff --git a/homeassistant/components/demo/cover.py b/homeassistant/components/demo/cover.py index fbb8a171516..845bd9976a3 100644 --- a/homeassistant/components/demo/cover.py +++ b/homeassistant/components/demo/cover.py @@ -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.""" diff --git a/homeassistant/components/demo/media_player.py b/homeassistant/components/demo/media_player.py index 8dbf059c2ca..e0c05e853c1 100644 --- a/homeassistant/components/demo/media_player.py +++ b/homeassistant/components/demo/media_player.py @@ -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" diff --git a/tests/components/google_assistant/__init__.py b/tests/components/google_assistant/__init__.py index 423bb1b55d7..2122818bbb4 100644 --- a/tests/components/google_assistant/__init__.py +++ b/tests/components/google_assistant/__init__.py @@ -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, }, {