AlexxIT / SSHCommand

Run any SSH command on remote server from Home Assistant service call
https://github.com/AlexxIT/Blog
MIT License
89 stars 7 forks source link

name 'paramiko' is not defined #1

Closed Pre10der closed 3 years ago

Pre10der commented 3 years ago

I am trying to use this custom_component as a basis to something I am working on. When I add it as is and ry to call it in Home Assistant, I receive the following error:

Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/manage_guest_wifi/__init__.py:17
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 22:32:16 (1 occurrences)
Last logged: 22:32:16

[140209633671536] name 'paramiko' is not defined
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 135, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1451, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1486, in _execute_service
    await handler.job.target(service_call)
  File "/config/custom_components/sshcommand/__init__.py", line 17, in exec_command
    ssh = paramiko.SSHClient()
NameError: name 'paramiko' is not defined

What am I missing? Is there anything else I need to do to get the paramiko library to be available to Home Assistant?

Pre10der commented 3 years ago

Please ignore....I was prefixing my SSHClient() call with "paramiko." which was not necessary.