Allow specifying port for wake_on_lan (#36510)
This commit is contained in:
1 parent
59f935beb0
commit
f1d5f95f7c
6 files changed
+56
-11
No files matched your search
@@ -13,18 +13,20 @@ async def test_send_magic_packet(hass):
|
||||
with patch("homeassistant.components.wake_on_lan.wakeonlan") as mocked_wakeonlan:
|
||||
mac = "aa:bb:cc:dd:ee:ff"
|
||||
bc_ip = "192.168.255.255"
|
||||
bc_port = 999
|
||||
|
||||
await async_setup_component(hass, DOMAIN, {})
|
||||
|
||||
await hass.services.async_call(
|
||||
DOMAIN,
|
||||
SERVICE_SEND_MAGIC_PACKET,
|
||||
{"mac": mac, "broadcast_address": bc_ip},
|
||||
{"mac": mac, "broadcast_address": bc_ip, "broadcast_port": bc_port},
|
||||
blocking=True,
|
||||
)
|
||||
assert len(mocked_wakeonlan.mock_calls) == 1
|
||||
assert mocked_wakeonlan.mock_calls[-1][1][0] == mac
|
||||
assert mocked_wakeonlan.mock_calls[-1][2]["ip_address"] == bc_ip
|
||||
assert mocked_wakeonlan.mock_calls[-1][2]["port"] == bc_port
|
||||
|
||||
with pytest.raises(vol.Invalid):
|
||||
await hass.services.async_call(
|
||||
|
||||
@@ -126,6 +126,7 @@ class TestWolSwitch(unittest.TestCase):
|
||||
"platform": "wake_on_lan",
|
||||
"mac": "00-01-02-03-04-05",
|
||||
"broadcast_address": "255.255.255.255",
|
||||
"broadcast_port": 999,
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user