Update pymitv dependency (#19601)

* Security update, fixed fatal error when TV could become unresponsive

* Dependency update
This commit is contained in:
Simon Nørager Sørensen 2018-12-27 17:38:07 +01:00 committed by Fabian Affolter
parent bf8b201bb3
commit 40bb4266c9
2 changed files with 8 additions and 6 deletions

View File

@ -14,7 +14,7 @@ from homeassistant.components.media_player import (
from homeassistant.const import CONF_HOST, CONF_NAME, STATE_OFF, STATE_ON from homeassistant.const import CONF_HOST, CONF_NAME, STATE_OFF, STATE_ON
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
REQUIREMENTS = ['pymitv==1.4.0'] REQUIREMENTS = ['pymitv==1.4.3']
DEFAULT_NAME = "Xiaomi TV" DEFAULT_NAME = "Xiaomi TV"
@ -93,15 +93,17 @@ class XiaomiTV(MediaPlayerDevice):
because the TV won't accept any input when turned off. Thus, the user because the TV won't accept any input when turned off. Thus, the user
would be unable to turn the TV back on, unless it's done manually. would be unable to turn the TV back on, unless it's done manually.
""" """
self._tv.sleep() if self._state is not STATE_OFF:
self._tv.sleep()
self._state = STATE_OFF self._state = STATE_OFF
def turn_on(self): def turn_on(self):
"""Wake the TV back up from sleep.""" """Wake the TV back up from sleep."""
self._tv.wake() if self._state is not STATE_ON:
self._tv.wake()
self._state = STATE_ON self._state = STATE_ON
def volume_up(self): def volume_up(self):
"""Increase volume by one.""" """Increase volume by one."""

View File

@ -1080,7 +1080,7 @@ pymailgunner==1.4
pymediaroom==0.6.4 pymediaroom==0.6.4
# homeassistant.components.media_player.xiaomi_tv # homeassistant.components.media_player.xiaomi_tv
pymitv==1.4.0 pymitv==1.4.3
# homeassistant.components.mochad # homeassistant.components.mochad
pymochad==0.2.0 pymochad==0.2.0