Upgrade wakeonlan to 1.0.0 (#12190)
parent
e7a0759e1c
commit
98b47cecbd
|
@ -19,7 +19,7 @@ from homeassistant.const import (
|
|||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
REQUIREMENTS = ['panasonic_viera==0.3',
|
||||
'wakeonlan==0.2.2']
|
||||
'wakeonlan==1.0.0']
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
@ -72,9 +72,9 @@ class PanasonicVieraTVDevice(MediaPlayerDevice):
|
|||
|
||||
def __init__(self, mac, name, remote):
|
||||
"""Initialize the Panasonic device."""
|
||||
from wakeonlan import wol
|
||||
import wakeonlan
|
||||
# Save a reference to the imported class
|
||||
self._wol = wol
|
||||
self._wol = wakeonlan
|
||||
self._mac = mac
|
||||
self._name = name
|
||||
self._muted = False
|
||||
|
|
|
@ -23,7 +23,7 @@ from homeassistant.const import (
|
|||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.util import dt as dt_util
|
||||
|
||||
REQUIREMENTS = ['samsungctl==0.6.0', 'wakeonlan==0.2.2']
|
||||
REQUIREMENTS = ['samsungctl==0.6.0', 'wakeonlan==1.0.0']
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
@ -92,13 +92,13 @@ class SamsungTVDevice(MediaPlayerDevice):
|
|||
"""Initialize the Samsung device."""
|
||||
from samsungctl import exceptions
|
||||
from samsungctl import Remote
|
||||
from wakeonlan import wol
|
||||
import wakeonlan
|
||||
# Save a reference to the imported classes
|
||||
self._exceptions_class = exceptions
|
||||
self._remote_class = Remote
|
||||
self._name = name
|
||||
self._mac = mac
|
||||
self._wol = wol
|
||||
self._wol = wakeonlan
|
||||
# Assume that the TV is not muted
|
||||
self._muted = False
|
||||
# Assume that the TV is in Play mode
|
||||
|
|
|
@ -26,7 +26,7 @@ import homeassistant.helpers.config_validation as cv
|
|||
from homeassistant.helpers.script import Script
|
||||
import homeassistant.util as util
|
||||
|
||||
REQUIREMENTS = ['pylgtv==0.1.7', 'websockets==3.2', 'wakeonlan==0.2.2']
|
||||
REQUIREMENTS = ['pylgtv==0.1.7', 'websockets==3.2']
|
||||
|
||||
_CONFIGURING = {} # type: Dict[str, str]
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
|
|
@ -15,7 +15,7 @@ import homeassistant.helpers.config_validation as cv
|
|||
from homeassistant.helpers.script import Script
|
||||
from homeassistant.const import (CONF_HOST, CONF_NAME)
|
||||
|
||||
REQUIREMENTS = ['wakeonlan==0.2.2']
|
||||
REQUIREMENTS = ['wakeonlan==1.0.0']
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
@ -53,7 +53,7 @@ class WOLSwitch(SwitchDevice):
|
|||
def __init__(self, hass, name, host, mac_address,
|
||||
off_action, broadcast_address):
|
||||
"""Initialize the WOL switch."""
|
||||
from wakeonlan import wol
|
||||
import wakeonlan
|
||||
self._hass = hass
|
||||
self._name = name
|
||||
self._host = host
|
||||
|
@ -61,7 +61,7 @@ class WOLSwitch(SwitchDevice):
|
|||
self._broadcast_address = broadcast_address
|
||||
self._off_script = Script(hass, off_action) if off_action else None
|
||||
self._state = False
|
||||
self._wol = wol
|
||||
self._wol = wakeonlan
|
||||
|
||||
@property
|
||||
def should_poll(self):
|
||||
|
|
|
@ -13,7 +13,7 @@ import voluptuous as vol
|
|||
from homeassistant.const import CONF_MAC
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
REQUIREMENTS = ['wakeonlan==0.2.2']
|
||||
REQUIREMENTS = ['wakeonlan==1.0.0']
|
||||
|
||||
DOMAIN = "wake_on_lan"
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
@ -31,7 +31,7 @@ WAKE_ON_LAN_SEND_MAGIC_PACKET_SCHEMA = vol.Schema({
|
|||
@asyncio.coroutine
|
||||
def async_setup(hass, config):
|
||||
"""Set up the wake on LAN component."""
|
||||
from wakeonlan import wol
|
||||
import wakeonlan
|
||||
|
||||
@asyncio.coroutine
|
||||
def send_magic_packet(call):
|
||||
|
@ -42,11 +42,11 @@ def async_setup(hass, config):
|
|||
mac_address, broadcast_address)
|
||||
if broadcast_address is not None:
|
||||
yield from hass.async_add_job(
|
||||
partial(wol.send_magic_packet, mac_address,
|
||||
partial(wakeonlan.send_magic_packet, mac_address,
|
||||
ip_address=broadcast_address))
|
||||
else:
|
||||
yield from hass.async_add_job(
|
||||
partial(wol.send_magic_packet, mac_address))
|
||||
partial(wakeonlan.send_magic_packet, mac_address))
|
||||
|
||||
hass.services.async_register(
|
||||
DOMAIN, SERVICE_SEND_MAGIC_PACKET, send_magic_packet,
|
||||
|
|
|
@ -1213,9 +1213,8 @@ vultr==0.1.2
|
|||
# homeassistant.components.wake_on_lan
|
||||
# homeassistant.components.media_player.panasonic_viera
|
||||
# homeassistant.components.media_player.samsungtv
|
||||
# homeassistant.components.media_player.webostv
|
||||
# homeassistant.components.switch.wake_on_lan
|
||||
wakeonlan==0.2.2
|
||||
wakeonlan==1.0.0
|
||||
|
||||
# homeassistant.components.sensor.waqi
|
||||
waqiasync==1.0.0
|
||||
|
|
|
@ -183,9 +183,8 @@ vultr==0.1.2
|
|||
# homeassistant.components.wake_on_lan
|
||||
# homeassistant.components.media_player.panasonic_viera
|
||||
# homeassistant.components.media_player.samsungtv
|
||||
# homeassistant.components.media_player.webostv
|
||||
# homeassistant.components.switch.wake_on_lan
|
||||
wakeonlan==0.2.2
|
||||
wakeonlan==1.0.0
|
||||
|
||||
# homeassistant.components.cloud
|
||||
warrant==0.6.1
|
||||
|
|
|
@ -40,7 +40,7 @@ class TestWOLSwitch(unittest.TestCase):
|
|||
"""Stop everything that was started."""
|
||||
self.hass.stop()
|
||||
|
||||
@patch('wakeonlan.wol.send_magic_packet', new=send_magic_packet)
|
||||
@patch('wakeonlan.send_magic_packet', new=send_magic_packet)
|
||||
@patch('subprocess.call', new=call)
|
||||
def test_valid_hostname(self):
|
||||
"""Test with valid hostname."""
|
||||
|
@ -71,7 +71,7 @@ class TestWOLSwitch(unittest.TestCase):
|
|||
state = self.hass.states.get('switch.wake_on_lan')
|
||||
self.assertEqual(STATE_ON, state.state)
|
||||
|
||||
@patch('wakeonlan.wol.send_magic_packet', new=send_magic_packet)
|
||||
@patch('wakeonlan.send_magic_packet', new=send_magic_packet)
|
||||
@patch('subprocess.call', new=call)
|
||||
@patch('platform.system', new=system)
|
||||
def test_valid_hostname_windows(self):
|
||||
|
@ -97,7 +97,7 @@ class TestWOLSwitch(unittest.TestCase):
|
|||
state = self.hass.states.get('switch.wake_on_lan')
|
||||
self.assertEqual(STATE_ON, state.state)
|
||||
|
||||
@patch('wakeonlan.wol.send_magic_packet', new=send_magic_packet)
|
||||
@patch('wakeonlan.send_magic_packet', new=send_magic_packet)
|
||||
@patch('subprocess.call', new=call)
|
||||
def test_minimal_config(self):
|
||||
"""Test with minimal config."""
|
||||
|
@ -108,7 +108,7 @@ class TestWOLSwitch(unittest.TestCase):
|
|||
}
|
||||
}))
|
||||
|
||||
@patch('wakeonlan.wol.send_magic_packet', new=send_magic_packet)
|
||||
@patch('wakeonlan.send_magic_packet', new=send_magic_packet)
|
||||
@patch('subprocess.call', new=call)
|
||||
def test_broadcast_config(self):
|
||||
"""Test with broadcast address config."""
|
||||
|
@ -126,7 +126,7 @@ class TestWOLSwitch(unittest.TestCase):
|
|||
switch.turn_on(self.hass, 'switch.wake_on_lan')
|
||||
self.hass.block_till_done()
|
||||
|
||||
@patch('wakeonlan.wol.send_magic_packet', new=send_magic_packet)
|
||||
@patch('wakeonlan.send_magic_packet', new=send_magic_packet)
|
||||
@patch('subprocess.call', new=call)
|
||||
def test_off_script(self):
|
||||
"""Test with turn off script."""
|
||||
|
@ -165,7 +165,7 @@ class TestWOLSwitch(unittest.TestCase):
|
|||
self.assertEqual(STATE_OFF, state.state)
|
||||
assert len(calls) == 1
|
||||
|
||||
@patch('wakeonlan.wol.send_magic_packet', new=send_magic_packet)
|
||||
@patch('wakeonlan.send_magic_packet', new=send_magic_packet)
|
||||
@patch('subprocess.call', new=call)
|
||||
@patch('platform.system', new=system)
|
||||
def test_invalid_hostname_windows(self):
|
||||
|
|
Loading…
Reference in New Issue