Skip to content

Fix error during setup process of Mikrotik#30810

Merged
pvizeli merged 1 commit into
home-assistant:devfrom
springstan:fix-mikrotik-hub
Jan 16, 2020
Merged

Fix error during setup process of Mikrotik#30810
pvizeli merged 1 commit into
home-assistant:devfrom
springstan:fix-mikrotik-hub

Conversation

@springstan
Copy link
Copy Markdown
Member

Description:

  • this PR solves an error during setup of a Mikrotik hub
  • example error:
2020-01-15 21:25:42 ERROR (MainThread) [homeassistant.setup] Error during setup of component mikrotik
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/setup.py", line 176, in _async_setup_component
    component.setup, hass, processed_config  # type: ignore
  File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/mikrotik/__init__.py", line 94, in setup
    api.connect_to_device()
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/mikrotik/__init__.py", line 153, in connect_to_device
    self.hostname = self.get_hostname()
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/mikrotik/__init__.py", line 160, in get_hostname
    return data[0][NAME] if data else None
TypeError: 'generator' object is not subscriptable

Related issue (if applicable): fixes #30745
Related PR (if applicable): completes #30800

Example entry for configuration.yaml (if applicable):

mikrotik:
  - host: 192.168.1.1
    username: secret
    password: secret
    login_method: plain
    port: 8728

Checklist:

@probot-home-assistant probot-home-assistant Bot added integration: mikrotik small-pr PRs with less than 30 lines. labels Jan 15, 2020
@frenck frenck added this to the 0.104.1 milestone Jan 16, 2020
@pvizeli pvizeli merged commit 9d5a391 into home-assistant:dev Jan 16, 2020
balloob pushed a commit that referenced this pull request Jan 16, 2020
@balloob balloob mentioned this pull request Jan 16, 2020
@lock lock Bot locked and limited conversation to collaborators Jan 17, 2020
@springstan springstan deleted the fix-mikrotik-hub branch April 7, 2020 14:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mikrotik hub is broken?

5 participants