Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- name: Checkout sources
uses: actions/[email protected]
Expand Down
6 changes: 2 additions & 4 deletions devolo_plc_api/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def __init__(
self._zeroconf_instance = zeroconf_instance
logging.captureWarnings(capture=True)

self._loop: asyncio.AbstractEventLoop
self._session: AsyncClient
self._zeroconf: AsyncZeroconf

Expand Down Expand Up @@ -148,8 +147,7 @@ async def async_connect(self, session_instance: AsyncClient | None = None) -> No

def connect(self) -> None:
"""Connect to a device synchronous."""
self._loop = asyncio.get_event_loop()
self._loop.run_until_complete(self.async_connect())
asyncio.run(self.async_connect())

async def async_disconnect(self) -> None:
"""Disconnect from a device asynchronous."""
Expand All @@ -164,7 +162,7 @@ async def async_disconnect(self) -> None:

def disconnect(self) -> None:
"""Disconnect from a device synchronous."""
self._loop.run_until_complete(self.async_disconnect())
asyncio.run(self.async_disconnect())

async def _get_relevant_interfaces(self) -> list[str]:
"""Get the IP address of the relevant interface to reduce traffic."""
Expand Down
2 changes: 0 additions & 2 deletions tests/test_device.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Test communicating with a devolo device."""

from asyncio import get_event_loop
from unittest.mock import AsyncMock, Mock, patch

import pytest
Expand Down Expand Up @@ -107,7 +106,6 @@ async def test_async_disconnect(self, mock_device: Device):
def test_disconnect(self, mock_device: Device):
"""Test that the sync disconnect method just calls the async disconnect method."""
with patch("devolo_plc_api.device.Device.async_disconnect", new=AsyncMock()) as ad:
mock_device._loop = get_event_loop()
mock_device.disconnect()
assert ad.call_count == 1

Expand Down