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

Move imports to top level for wake_on_lan #27415

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions homeassistant/components/wake_on_lan/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""Support for sending Wake-On-LAN magic packets."""
from functools import partial
import logging

import voluptuous as vol
import wakeonlan

from homeassistant.const import CONF_MAC
import homeassistant.helpers.config_validation as cv
Expand All @@ -22,7 +22,6 @@

async def async_setup(hass, config):
"""Set up the wake on LAN component."""
import wakeonlan

async def send_magic_packet(call):
"""Send magic packet to wake up a device."""
Expand Down
4 changes: 1 addition & 3 deletions homeassistant/components/wake_on_lan/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import logging
import platform
import subprocess as sp

import voluptuous as vol
import wakeonlan

from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchDevice
from homeassistant.const import CONF_HOST, CONF_NAME
Expand Down Expand Up @@ -48,8 +48,6 @@ class WOLSwitch(SwitchDevice):

def __init__(self, hass, name, host, mac_address, off_action, broadcast_address):
"""Initialize the WOL switch."""
import wakeonlan

self._hass = hass
self._name = name
self._host = host
Expand Down