Convert philips_js to entity naming (#74721)

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
Joakim Plate 2022-07-09 19:34:51 +02:00 committed by GitHub
parent cdcc73a414
commit 4080d2b0da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 4 deletions

View file

@ -137,6 +137,8 @@ class PhilipsTVLightEntity(
):
"""Representation of a Philips TV exposing the JointSpace API."""
_attr_has_entity_name = True
def __init__(
self,
coordinator: PhilipsTVDataUpdateCoordinator,
@ -151,7 +153,7 @@ class PhilipsTVLightEntity(
self._attr_supported_color_modes = {ColorMode.HS, ColorMode.ONOFF}
self._attr_supported_features = LightEntityFeature.EFFECT
self._attr_name = f"{coordinator.system['name']} Ambilight"
self._attr_name = "Ambilight"
self._attr_unique_id = coordinator.unique_id
self._attr_icon = "mdi:television-ambient-light"
self._attr_device_info = DeviceInfo(

View file

@ -73,6 +73,7 @@ class PhilipsTVMediaPlayer(
"""Representation of a Philips TV exposing the JointSpace API."""
_attr_device_class = MediaPlayerDeviceClass.TV
_attr_has_entity_name = True
def __init__(
self,
@ -83,7 +84,6 @@ class PhilipsTVMediaPlayer(
self._sources: dict[str, str] = {}
self._supports = SUPPORT_PHILIPS_JS
self._system = coordinator.system
self._attr_name = coordinator.system["name"]
self._attr_unique_id = coordinator.unique_id
self._attr_device_info = DeviceInfo(
identifiers={

View file

@ -30,6 +30,8 @@ async def async_setup_entry(
class PhilipsTVRemote(CoordinatorEntity[PhilipsTVDataUpdateCoordinator], RemoteEntity):
"""Device that sends commands."""
_attr_has_entity_name = True
def __init__(
self,
coordinator: PhilipsTVDataUpdateCoordinator,
@ -37,7 +39,7 @@ class PhilipsTVRemote(CoordinatorEntity[PhilipsTVDataUpdateCoordinator], RemoteE
"""Initialize the Philips TV."""
super().__init__(coordinator)
self._tv = coordinator.api
self._attr_name = f"{coordinator.system['name']} Remote"
self._attr_name = "Remote"
self._attr_unique_id = coordinator.unique_id
self._attr_device_info = DeviceInfo(
identifiers={

View file

@ -38,6 +38,8 @@ class PhilipsTVScreenSwitch(
):
"""A Philips TV screen state switch."""
_attr_has_entity_name = True
def __init__(
self,
coordinator: PhilipsTVDataUpdateCoordinator,
@ -46,7 +48,7 @@ class PhilipsTVScreenSwitch(
super().__init__(coordinator)
self._attr_name = f"{coordinator.system['name']} Screen State"
self._attr_name = "Screen state"
self._attr_icon = "mdi:television-shimmer"
self._attr_unique_id = f"{coordinator.unique_id}_screenstate"
self._attr_device_info = DeviceInfo(