Add is_volume_muted property to vizio integration (#32332)

* add is_muted property and update tests

* black

* manually set is_muted on async_mute_volume calls to set state early

* combine two lines into one

* set is_muted to None when device is not on
This commit is contained in:
Raman Gupta authored and GitHub committed 2020-03-04 10:04:52 +01:00
1 parent 6a6bf517fe
commit 4f619691df
4 files changed
+24 -9

No files matched your search

+5 -2
View File
@@ -132,8 +132,11 @@ def vizio_update_fixture():
"homeassistant.components.vizio.media_player.VizioAsync.can_connect_with_auth_check",
return_value=True,
), patch(
"homeassistant.components.vizio.media_player.VizioAsync.get_current_volume",
return_value=int(MAX_VOLUME[DEVICE_CLASS_SPEAKER] / 2),
"homeassistant.components.vizio.media_player.VizioAsync.get_all_audio_settings",
return_value={
"volume": int(MAX_VOLUME[DEVICE_CLASS_SPEAKER] / 2),
"mute": "Off",
},
), patch(
"homeassistant.components.vizio.media_player.VizioAsync.get_current_input",
return_value=CURRENT_INPUT,
+2 -2
View File
@@ -69,8 +69,8 @@ async def _test_setup(
)
with patch(
"homeassistant.components.vizio.media_player.VizioAsync.get_current_volume",
return_value=int(MAX_VOLUME[vizio_device_class] / 2),
"homeassistant.components.vizio.media_player.VizioAsync.get_all_audio_settings",
return_value={"volume": int(MAX_VOLUME[vizio_device_class] / 2), "mute": "Off"},
), patch(
"homeassistant.components.vizio.media_player.VizioAsync.get_power_state",
return_value=vizio_power_state,