python-swidget 1.4.12__tar.gz → 1.4.13__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.4.12 → python_swidget-1.4.13}/PKG-INFO +1 -1
- {python_swidget-1.4.12 → python_swidget-1.4.13}/pyproject.toml +1 -1
- {python_swidget-1.4.12 → python_swidget-1.4.13}/swidget/swidgetdevice.py +20 -0
- {python_swidget-1.4.12 → python_swidget-1.4.13}/README.md +0 -0
- {python_swidget-1.4.12 → python_swidget-1.4.13}/swidget/__init__.py +0 -0
- {python_swidget-1.4.12 → python_swidget-1.4.13}/swidget/cli.py +0 -0
- {python_swidget-1.4.12 → python_swidget-1.4.13}/swidget/discovery.py +0 -0
- {python_swidget-1.4.12 → python_swidget-1.4.13}/swidget/exceptions.py +0 -0
- {python_swidget-1.4.12 → python_swidget-1.4.13}/swidget/provision.py +0 -0
- {python_swidget-1.4.12 → python_swidget-1.4.13}/swidget/py.typed +0 -0
- {python_swidget-1.4.12 → python_swidget-1.4.13}/swidget/swidgetdimmer.py +0 -0
- {python_swidget-1.4.12 → python_swidget-1.4.13}/swidget/swidgetoutlet.py +0 -0
- {python_swidget-1.4.12 → python_swidget-1.4.13}/swidget/swidgetswitch.py +0 -0
- {python_swidget-1.4.12 → python_swidget-1.4.13}/swidget/swidgettimerswitch.py +0 -0
- {python_swidget-1.4.12 → python_swidget-1.4.13}/swidget/websocket.py +0 -0
|
@@ -924,6 +924,26 @@ class SwidgetDevice:
|
|
|
924
924
|
{"insert": {"components": {"video": {"rtsp": {"enable": bool(enabled)}}}}}
|
|
925
925
|
)
|
|
926
926
|
|
|
927
|
+
@property
|
|
928
|
+
def rtsp_stream_source(self) -> Optional[str]:
|
|
929
|
+
"""Return the device's RTSP URL, or None when unavailable.
|
|
930
|
+
|
|
931
|
+
Path ``/ph264`` is fixed by firmware; the port comes from device
|
|
932
|
+
config. None if RTSP is disabled, the insert isn't video, or the
|
|
933
|
+
config hasn't been loaded yet.
|
|
934
|
+
"""
|
|
935
|
+
if self.rtsp_enabled is not True:
|
|
936
|
+
return None
|
|
937
|
+
try:
|
|
938
|
+
port = int(
|
|
939
|
+
self.device_config.config["insert"]["components"]["video"]["rtsp"][
|
|
940
|
+
"port"
|
|
941
|
+
]
|
|
942
|
+
)
|
|
943
|
+
except (KeyError, TypeError, ValueError):
|
|
944
|
+
return None
|
|
945
|
+
return f"rtsp://{self.ip_address}:{port}/ph264"
|
|
946
|
+
|
|
927
947
|
async def __aenter__(self) -> "SwidgetDevice":
|
|
928
948
|
"""Initialize and connect the Swidget Websocket client."""
|
|
929
949
|
await self.connect()
|
|
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
|
|
File without changes
|