mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
media_player: remove debug messages, change IDLE to ON
This commit is contained in:
parent
34a6524019
commit
117a0018a5
@ -48,7 +48,7 @@ from homeassistant.components.media_player import (
|
|||||||
SUPPORT_TURN_ON, SUPPORT_TURN_OFF,
|
SUPPORT_TURN_ON, SUPPORT_TURN_OFF,
|
||||||
DOMAIN)
|
DOMAIN)
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
CONF_HOST, STATE_OFF, STATE_IDLE, STATE_UNKNOWN)
|
CONF_HOST, STATE_OFF, STATE_ON, STATE_UNKNOWN)
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -94,9 +94,8 @@ class DenonDevice(MediaPlayerDevice):
|
|||||||
except (EOFError, BrokenPipeError, ConnectionResetError):
|
except (EOFError, BrokenPipeError, ConnectionResetError):
|
||||||
self._telnet.open(self._host)
|
self._telnet.open(self._host)
|
||||||
|
|
||||||
_LOGGER.error(self._telnet.read_very_eager()) # skip
|
self._telnet.read_very_eager() # skip what is not requested
|
||||||
|
|
||||||
_LOGGER.error(message)
|
|
||||||
self._telnet.write(message.encode('ASCII') + b'\r')
|
self._telnet.write(message.encode('ASCII') + b'\r')
|
||||||
# timeout 200ms, defined by protocol
|
# timeout 200ms, defined by protocol
|
||||||
resp = self._telnet.read_until(b'\r', timeout=0.2)\
|
resp = self._telnet.read_until(b'\r', timeout=0.2)\
|
||||||
@ -104,8 +103,8 @@ class DenonDevice(MediaPlayerDevice):
|
|||||||
|
|
||||||
if message == "PW?":
|
if message == "PW?":
|
||||||
# workaround; PW? sends also SISTATUS
|
# workaround; PW? sends also SISTATUS
|
||||||
_LOGGER.error(self._telnet.read_until(b'\r', timeout=0.2))
|
self._telnet.read_until(b'\r', timeout=0.2)
|
||||||
_LOGGER.error(resp)
|
|
||||||
return resp
|
return resp
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -120,7 +119,7 @@ class DenonDevice(MediaPlayerDevice):
|
|||||||
if pwstate == "PWSTANDBY":
|
if pwstate == "PWSTANDBY":
|
||||||
return STATE_OFF
|
return STATE_OFF
|
||||||
if pwstate == "PWON":
|
if pwstate == "PWON":
|
||||||
return STATE_IDLE
|
return STATE_ON
|
||||||
|
|
||||||
return STATE_UNKNOWN
|
return STATE_UNKNOWN
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user