python-swidget 1.2.3__tar.gz → 1.2.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_swidget-1.2.3 → python_swidget-1.2.5}/PKG-INFO +3 -2
- {python_swidget-1.2.3 → python_swidget-1.2.5}/pyproject.toml +2 -2
- {python_swidget-1.2.3 → python_swidget-1.2.5}/swidget/discovery.py +1 -1
- {python_swidget-1.2.3 → python_swidget-1.2.5}/swidget/swidgetdevice.py +9 -4
- {python_swidget-1.2.3 → python_swidget-1.2.5}/README.md +0 -0
- {python_swidget-1.2.3 → python_swidget-1.2.5}/swidget/__init__.py +0 -0
- {python_swidget-1.2.3 → python_swidget-1.2.5}/swidget/cli.py +0 -0
- {python_swidget-1.2.3 → python_swidget-1.2.5}/swidget/exceptions.py +0 -0
- {python_swidget-1.2.3 → python_swidget-1.2.5}/swidget/provision.py +0 -0
- {python_swidget-1.2.3 → python_swidget-1.2.5}/swidget/py.typed +0 -0
- {python_swidget-1.2.3 → python_swidget-1.2.5}/swidget/swidgetdimmer.py +0 -0
- {python_swidget-1.2.3 → python_swidget-1.2.5}/swidget/swidgetoutlet.py +0 -0
- {python_swidget-1.2.3 → python_swidget-1.2.5}/swidget/swidgetswitch.py +0 -0
- {python_swidget-1.2.3 → python_swidget-1.2.5}/swidget/swidgettimerswitch.py +0 -0
- {python_swidget-1.2.3 → python_swidget-1.2.5}/swidget/websocket.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python-swidget
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.5
|
|
4
4
|
Summary: Python API for Swidget smart devices
|
|
5
5
|
Home-page: https://github.com/swidget/python-swidget
|
|
6
6
|
License: GPL-3.0-or-later
|
|
@@ -13,6 +13,7 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.10
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.11
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
17
|
Provides-Extra: docs
|
|
17
18
|
Requires-Dist: aiohttp (>=3.8.1)
|
|
18
19
|
Requires-Dist: anyio
|
|
@@ -21,7 +22,7 @@ Requires-Dist: importlib-metadata
|
|
|
21
22
|
Requires-Dist: m2r (>=0,<1) ; extra == "docs"
|
|
22
23
|
Requires-Dist: mistune (<2.0.0) ; extra == "docs"
|
|
23
24
|
Requires-Dist: pydantic (>=1,<2)
|
|
24
|
-
Requires-Dist: requests (==2.
|
|
25
|
+
Requires-Dist: requests (==2.32.3)
|
|
25
26
|
Requires-Dist: sphinx (>=4,<5) ; extra == "docs"
|
|
26
27
|
Requires-Dist: sphinx_rtd_theme (>=0,<1) ; extra == "docs"
|
|
27
28
|
Requires-Dist: sphinxcontrib-programoutput (>=0,<1) ; extra == "docs"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "python-swidget"
|
|
3
|
-
version = "1.2.
|
|
3
|
+
version = "1.2.5"
|
|
4
4
|
description = "Python API for Swidget smart devices"
|
|
5
5
|
license = "GPL-3.0-or-later"
|
|
6
6
|
authors = ["Swidget"]
|
|
@@ -22,7 +22,7 @@ importlib-metadata = "*"
|
|
|
22
22
|
asyncclick = ">=8"
|
|
23
23
|
pydantic = "^1"
|
|
24
24
|
ssdp = "1.1.1"
|
|
25
|
-
requests = "2.
|
|
25
|
+
requests = "2.32.3"
|
|
26
26
|
types-requests = "2.31.0.6"
|
|
27
27
|
urllib3 = '1.26.5'
|
|
28
28
|
|
|
@@ -59,7 +59,7 @@ class SwidgetProtocol(ssdp.SimpleServiceDiscoveryProtocol):
|
|
|
59
59
|
insert_type=insert_type,
|
|
60
60
|
)
|
|
61
61
|
_LOGGER.debug(
|
|
62
|
-
f"Swidget device '{friendly_name}' at {ip_address}
|
|
62
|
+
f"Discovered Swidget device via SSDP: '{friendly_name}' at {ip_address} Type:{device_type}/{insert_type}"
|
|
63
63
|
)
|
|
64
64
|
|
|
65
65
|
|
|
@@ -143,7 +143,7 @@ class SwidgetDevice:
|
|
|
143
143
|
"""Wrapper for the stop() function."""
|
|
144
144
|
await self.stop()
|
|
145
145
|
|
|
146
|
-
def add_event_callback(self, callback: Callable[[Any], Any]):
|
|
146
|
+
def add_event_callback(self, callback: Callable[[Any], Any]) -> bool:
|
|
147
147
|
"""Register a function to be called when a new websocket message is recieved."""
|
|
148
148
|
for c in self._subscribers:
|
|
149
149
|
if c == callback:
|
|
@@ -154,7 +154,7 @@ class SwidgetDevice:
|
|
|
154
154
|
self._subscribers.append(callback)
|
|
155
155
|
return True
|
|
156
156
|
|
|
157
|
-
def remove_event_callback(self, callback: Callable[[Any], Any]):
|
|
157
|
+
def remove_event_callback(self, callback: Callable[[Any], Any]) -> bool:
|
|
158
158
|
"""Remove a registered callback function."""
|
|
159
159
|
if callback in self._subscribers:
|
|
160
160
|
self._subscribers.remove(callback)
|
|
@@ -181,7 +181,7 @@ class SwidgetDevice:
|
|
|
181
181
|
)
|
|
182
182
|
await self.signal_callbacks(message)
|
|
183
183
|
|
|
184
|
-
async def signal_callbacks(self, message):
|
|
184
|
+
async def signal_callbacks(self, message) -> None:
|
|
185
185
|
"""Call any available registered callback functions."""
|
|
186
186
|
_LOGGER.debug("SwidgetDevice.signal_callsbacks() called")
|
|
187
187
|
for callback in self._subscribers:
|
|
@@ -608,9 +608,14 @@ class SwidgetDevice:
|
|
|
608
608
|
if InsertType.VIDEO.value in self.insert_features:
|
|
609
609
|
try:
|
|
610
610
|
snapshot_url = self.snapshot_url
|
|
611
|
+
headers = self._session.headers.copy()
|
|
612
|
+
if width is not None and height is not None:
|
|
613
|
+
headers.update(
|
|
614
|
+
{"x-picture-width": str(width), "x-picture-height": str(height)}
|
|
615
|
+
)
|
|
611
616
|
if isinstance(snapshot_url, str):
|
|
612
617
|
async with self._session.get(
|
|
613
|
-
url=snapshot_url, ssl=False
|
|
618
|
+
url=snapshot_url, headers=headers, ssl=False
|
|
614
619
|
) as response:
|
|
615
620
|
if response.status == 200:
|
|
616
621
|
return await response.read()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|