Improve type hint in denon media player entity (#77036)
This commit is contained in:
parent
1edb68f8ba
commit
c9fe1f44b8
1 changed files with 6 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue