Use is_screensaver

This commit is contained in:
Robbie Trencheny 2017-01-20 20:23:20 -08:00 committed by GitHub
parent d31f00f672
commit 6b0a6b87de

View File

@ -17,8 +17,8 @@ from homeassistant.const import (
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
REQUIREMENTS = [ REQUIREMENTS = [
'https://github.com/bah2830/python-roku/archive/3.1.2.zip' 'https://github.com/bah2830/python-roku/archive/3.1.3.zip'
'#roku==3.1.2'] '#roku==3.1.3']
KNOWN_HOSTS = [] KNOWN_HOSTS = []
DEFAULT_PORT = 8060 DEFAULT_PORT = 8060
@ -114,8 +114,8 @@ class RokuDevice(MediaPlayerDevice):
if self.current_app is None: if self.current_app is None:
return STATE_UNKNOWN return STATE_UNKNOWN
idle_list = ["Power Saver", "Screensaver", "screensaver"] if (self.current_app.name == "Power Saver" or
if any(idle_type in self.current_app.name for idle_type in idle_list): self.current_app.is_screensaver):
return STATE_IDLE return STATE_IDLE
elif self.current_app.name == "Roku": elif self.current_app.name == "Roku":
return STATE_HOME return STATE_HOME