Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "enable_telnet" to gateway #734

Merged
merged 3 commits into from Jun 26, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 13 additions & 1 deletion miio/gateway.py
Expand Up @@ -10,7 +10,7 @@

from .click_common import EnumType, command, format_output
from .device import Device
from .exceptions import DeviceException
from .exceptions import DeviceError, DeviceException
from .utils import brightness_and_color_to_int, int_to_brightness, int_to_rgb

_LOGGER = logging.getLogger(__name__)
Expand Down Expand Up @@ -332,6 +332,18 @@ def set_developer_key(self, key):

return self.send("set_lumi_dpf_aes_key", [key])

@command()
def enable_telnet(self):
"""Enable root telnet acces to the operating system, use login "admin" or "app", no password."""
try:
return self.send("enable_telnet_service")
except DeviceError:
_LOGGER.error(
"Gateway model '%s' does not (yet) support enabling the telnet interface",
self.model,
)
return None

@command()
def timezone(self):
"""Get current timezone."""
Expand Down