Use byte literals instead of encode (#33633)

This commit is contained in:
Franck Nijhof authored and GitHub committed 2020-04-04 20:02:50 +02:00
1 parent 39a01fcdc6
commit d85222ad80
4 files changed
+7 -7

No files matched your search

@@ -99,11 +99,11 @@ class ActiontecDeviceScanner(DeviceScanner):
telnet.read_until(b"Password: ")
telnet.write((self.password + "\n").encode("ascii"))
prompt = telnet.read_until(b"Wireless Broadband Router> ").split(b"\n")[-1]
telnet.write("firewall mac_cache_dump\n".encode("ascii"))
telnet.write("\n".encode("ascii"))
telnet.write(b"firewall mac_cache_dump\n")
telnet.write(b"\n")
telnet.read_until(prompt)
leases_result = telnet.read_until(prompt).split(b"\n")[1:-1]
telnet.write("exit\n".encode("ascii"))
telnet.write(b"exit\n")
except EOFError:
_LOGGER.exception("Unexpected response from router")
return