mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 14:27:07 +00:00
Improve type hint in denon media player entity (#77036)
This commit is contained in:
parent
1edb68f8ba
commit
c9fe1f44b8
@ -84,7 +84,7 @@ def setup_platform(
|
||||
"""Set up the Denon platform."""
|
||||
denon = DenonDevice(config[CONF_NAME], config[CONF_HOST])
|
||||
|
||||
if denon.update():
|
||||
if denon.do_update():
|
||||
add_entities([denon])
|
||||
|
||||
|
||||
@ -161,8 +161,12 @@ class DenonDevice(MediaPlayerEntity):
|
||||
telnet.read_very_eager() # skip response
|
||||
telnet.close()
|
||||
|
||||
def update(self):
|
||||
def update(self) -> None:
|
||||
"""Get the latest details from the device."""
|
||||
self.do_update()
|
||||
|
||||
def do_update(self) -> bool:
|
||||
"""Get the latest details from the device, as boolean."""
|
||||
try:
|
||||
telnet = telnetlib.Telnet(self._host)
|
||||
except OSError:
|
||||
|
Loading…
x
Reference in New Issue
Block a user