Skip to content

Commit

Permalink
Merge 0379d18 into bf8b201
Browse files Browse the repository at this point in the history
  • Loading branch information
simse committed Dec 27, 2018
2 parents bf8b201 + 0379d18 commit 9725087
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions homeassistant/components/media_player/xiaomi_tv.py
Expand Up @@ -14,7 +14,7 @@
from homeassistant.const import CONF_HOST, CONF_NAME, STATE_OFF, STATE_ON
import homeassistant.helpers.config_validation as cv

REQUIREMENTS = ['pymitv==1.4.0']
REQUIREMENTS = ['pymitv==1.4.3']

DEFAULT_NAME = "Xiaomi TV"

Expand Down Expand Up @@ -93,15 +93,17 @@ def turn_off(self):
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.
"""
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):
"""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):
"""Increase volume by one."""
Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Expand Up @@ -1080,7 +1080,7 @@ pymailgunner==1.4
pymediaroom==0.6.4

# homeassistant.components.media_player.xiaomi_tv
pymitv==1.4.0
pymitv==1.4.3

# homeassistant.components.mochad
pymochad==0.2.0
Expand Down

0 comments on commit 9725087

Please sign in to comment.