Bump pyvizio version and add additional device info (#31417)
* bump pyvizio version and add additional device info * add patches for get_model and get_version * change keywrod argument to positional for _test_service
This commit is contained in:
parent
744ae82933
commit
ee927fbc9e
7 changed files with 38 additions and 21 deletions
|
@ -107,9 +107,17 @@ class VizioDevice(MediaPlayerDevice):
|
|||
self._max_volume = float(self._device.get_max_volume())
|
||||
self._icon = ICON[device_class]
|
||||
self._available = True
|
||||
self._model = None
|
||||
self._sw_version = None
|
||||
|
||||
async def async_update(self) -> None:
|
||||
"""Retrieve latest state of the device."""
|
||||
if not self._model:
|
||||
self._model = await self._device.get_model()
|
||||
|
||||
if not self._sw_version:
|
||||
self._sw_version = await self._device.get_version()
|
||||
|
||||
is_on = await self._device.get_power_state(log_api_exception=False)
|
||||
|
||||
if is_on is None:
|
||||
|
@ -141,9 +149,9 @@ class VizioDevice(MediaPlayerDevice):
|
|||
|
||||
input_ = await self._device.get_current_input(log_api_exception=False)
|
||||
if input_ is not None:
|
||||
self._current_input = input_.meta_name
|
||||
self._current_input = input_
|
||||
|
||||
inputs = await self._device.get_inputs(log_api_exception=False)
|
||||
inputs = await self._device.get_inputs_list(log_api_exception=False)
|
||||
if inputs is not None:
|
||||
self._available_inputs = [input_.name for input_ in inputs]
|
||||
|
||||
|
@ -235,6 +243,8 @@ class VizioDevice(MediaPlayerDevice):
|
|||
"identifiers": {(DOMAIN, self._config_entry.unique_id)},
|
||||
"name": self.name,
|
||||
"manufacturer": "VIZIO",
|
||||
"model": self._model,
|
||||
"sw_version": self._sw_version,
|
||||
}
|
||||
|
||||
@property
|
||||
|
@ -267,7 +277,7 @@ class VizioDevice(MediaPlayerDevice):
|
|||
|
||||
async def async_select_source(self, source: str) -> None:
|
||||
"""Select input source."""
|
||||
await self._device.input_switch(source)
|
||||
await self._device.set_input(source)
|
||||
|
||||
async def async_volume_up(self) -> None:
|
||||
"""Increase volume of the device."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue