mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Add hardware version to Roku device info (#63249)
* add hardware version to Roku device info. * Update test_media_player.py * Update test_media_player.py * Update test_media_player.py
This commit is contained in:
parent
ea0b24a5f0
commit
c693b6f455
@ -31,6 +31,7 @@ class RokuEntity(CoordinatorEntity):
|
|||||||
name=self.coordinator.data.info.name,
|
name=self.coordinator.data.info.name,
|
||||||
manufacturer=self.coordinator.data.info.brand,
|
manufacturer=self.coordinator.data.info.brand,
|
||||||
model=self.coordinator.data.info.model_name,
|
model=self.coordinator.data.info.model_name,
|
||||||
|
hw_version=self.coordinator.data.info.model_number,
|
||||||
sw_version=self.coordinator.data.info.version,
|
sw_version=self.coordinator.data.info.version,
|
||||||
suggested_area=self.coordinator.data.info.device_location,
|
suggested_area=self.coordinator.data.info.device_location,
|
||||||
)
|
)
|
||||||
|
@ -85,12 +85,26 @@ async def test_setup(hass: HomeAssistant, aioclient_mock: AiohttpClientMocker) -
|
|||||||
await setup_integration(hass, aioclient_mock)
|
await setup_integration(hass, aioclient_mock)
|
||||||
|
|
||||||
entity_registry = er.async_get(hass)
|
entity_registry = er.async_get(hass)
|
||||||
main = entity_registry.async_get(MAIN_ENTITY_ID)
|
device_registry = dr.async_get(hass)
|
||||||
|
|
||||||
assert hass.states.get(MAIN_ENTITY_ID)
|
state = hass.states.get(MAIN_ENTITY_ID)
|
||||||
assert main
|
entry = entity_registry.async_get(MAIN_ENTITY_ID)
|
||||||
assert main.original_device_class is MediaPlayerDeviceClass.RECEIVER
|
|
||||||
assert main.unique_id == UPNP_SERIAL
|
assert state
|
||||||
|
assert entry
|
||||||
|
assert entry.original_device_class is MediaPlayerDeviceClass.RECEIVER
|
||||||
|
assert entry.unique_id == UPNP_SERIAL
|
||||||
|
|
||||||
|
assert entry.device_id
|
||||||
|
device_entry = device_registry.async_get(entry.device_id)
|
||||||
|
assert device_entry
|
||||||
|
assert device_entry.identifiers == {(DOMAIN, UPNP_SERIAL)}
|
||||||
|
assert device_entry.manufacturer == "Roku"
|
||||||
|
assert device_entry.model == "Roku 3"
|
||||||
|
assert device_entry.name == "My Roku 3"
|
||||||
|
assert device_entry.entry_type is None
|
||||||
|
assert device_entry.hw_version == "4200X"
|
||||||
|
assert device_entry.sw_version == "7.5.0"
|
||||||
|
|
||||||
|
|
||||||
async def test_idle_setup(
|
async def test_idle_setup(
|
||||||
@ -117,12 +131,26 @@ async def test_tv_setup(
|
|||||||
)
|
)
|
||||||
|
|
||||||
entity_registry = er.async_get(hass)
|
entity_registry = er.async_get(hass)
|
||||||
tv = entity_registry.async_get(TV_ENTITY_ID)
|
device_registry = dr.async_get(hass)
|
||||||
|
|
||||||
assert hass.states.get(TV_ENTITY_ID)
|
state = hass.states.get(TV_ENTITY_ID)
|
||||||
assert tv
|
entry = entity_registry.async_get(TV_ENTITY_ID)
|
||||||
assert tv.original_device_class is MediaPlayerDeviceClass.TV
|
|
||||||
assert tv.unique_id == TV_SERIAL
|
assert state
|
||||||
|
assert entry
|
||||||
|
assert entry.original_device_class is MediaPlayerDeviceClass.TV
|
||||||
|
assert entry.unique_id == TV_SERIAL
|
||||||
|
|
||||||
|
assert entry.device_id
|
||||||
|
device_entry = device_registry.async_get(entry.device_id)
|
||||||
|
assert device_entry
|
||||||
|
assert device_entry.identifiers == {(DOMAIN, TV_SERIAL)}
|
||||||
|
assert device_entry.manufacturer == TV_MANUFACTURER
|
||||||
|
assert device_entry.model == TV_MODEL
|
||||||
|
assert device_entry.name == '58" Onn Roku TV'
|
||||||
|
assert device_entry.entry_type is None
|
||||||
|
assert device_entry.hw_version == "7820X"
|
||||||
|
assert device_entry.sw_version == TV_SW_VERSION
|
||||||
|
|
||||||
|
|
||||||
async def test_availability(
|
async def test_availability(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user