Use DeviceInfo in vizio (#58617)

Co-authored-by: epenet <epenet@users.noreply.github.com>
pull/58628/head
epenet 2021-10-28 18:24:40 +02:00 committed by GitHub
parent 7e9a67194a
commit 7d235cb9bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 7 deletions

View File

@ -33,6 +33,7 @@ from homeassistant.helpers.dispatcher import (
async_dispatcher_connect,
async_dispatcher_send,
)
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
@ -194,13 +195,13 @@ class VizioDevice(MediaPlayerEntity):
self._attr_available = True
if not self._attr_device_info:
self._attr_device_info = {
"identifiers": {(DOMAIN, self._attr_unique_id)},
"name": self._attr_name,
"manufacturer": "VIZIO",
"model": await self._device.get_model_name(log_api_exception=False),
"sw_version": await self._device.get_version(log_api_exception=False),
}
self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, self._attr_unique_id)},
manufacturer="VIZIO",
model=await self._device.get_model_name(log_api_exception=False),
name=self._attr_name,
sw_version=await self._device.get_version(log_api_exception=False),
)
if not is_on:
self._attr_state = STATE_OFF