Environment
- Home Assistant Core 2026.7.4 (HAOS, Raspberry Pi 5)
- ha_creality_ws v0.9.7
- Printer: Creality K1 Max
- Camera in go2rtc-bridge mode (not direct signaling)
Bug
custom_components/ha_creality_ws/camera.py defines stream_source as a synchronous property returning the go2rtc stream name:
@property
def stream_source(self) -> Optional[str]:
"""Return the stream name for go2rtc. ..."""
if not self._uses_go2rtc_webrtc_bridge():
return None
return self._stream_name
Home Assistant core defines Camera.stream_source as an async method, and the stream (HLS) machinery calls it as one:
source = await self.stream_source()
Because the subclass property shadows the method, self.stream_source evaluates to a str (the stream name), and calling it raises:
TypeError: 'str' object is not callable
The result: WebRTC works fine, but any consumer of the classic stream pipeline — the
camera/stream WebSocket command, HLS playback, camera.record/camera.play_stream
services, casting, etc. — fails for this camera.
There is already a correct async variant right below it (async_get_stream_source), but HA
core never calls that name; the property is what gets hit.
Steps to reproduce
- Set up the integration with the camera in go2rtc mode.
- In a browser dev console (or any WS client), send
{"type": "camera/stream", "entity_id": "camera.<printer>_printer_camera"}.
- HA returns an error; the log shows the
TypeError: 'str' object is not callable traceback
in the stream component.
Fix that works for me (hand-patched locally)
Replace the property with an async method returning an actual RTSP URL on HA's internal
go2rtc (which HA's stream component can consume), and expose the stream name via
extra_state_attributes instead:
async def stream_source(self) -> Optional[str]:
if not self._uses_go2rtc_webrtc_bridge():
return None
await self._ensure_stream_configured()
if not self._stream_name:
return None
return f"rtsp://127.0.0.1:18554/{self._stream_name}"
(18554 = HA's internal go2rtc RTSP port.)
With this change camera/stream / HLS work.
Note for anyone else hitting this
Reloading the config entry does not re-import the module code — a full HA Core restart
is needed after patching.
Environment
Bug
custom_components/ha_creality_ws/camera.pydefinesstream_sourceas a synchronous property returning the go2rtc stream name:Home Assistant core defines
Camera.stream_sourceas an async method, and the stream (HLS) machinery calls it as one:Because the subclass property shadows the method,
self.stream_sourceevaluates to astr(the stream name), and calling it raises:The result: WebRTC works fine, but any consumer of the classic stream pipeline — the
camera/streamWebSocket command, HLS playback,camera.record/camera.play_streamservices, casting, etc. — fails for this camera.
There is already a correct async variant right below it (
async_get_stream_source), but HAcore never calls that name; the property is what gets hit.
Steps to reproduce
{"type": "camera/stream", "entity_id": "camera.<printer>_printer_camera"}.TypeError: 'str' object is not callabletracebackin the stream component.
Fix that works for me (hand-patched locally)
Replace the property with an async method returning an actual RTSP URL on HA's internal
go2rtc (which HA's stream component can consume), and expose the stream name via
extra_state_attributesinstead:(
18554= HA's internal go2rtc RTSP port.)With this change
camera/stream/ HLS work.Note for anyone else hitting this
Reloading the config entry does not re-import the module code — a full HA Core restart
is needed after patching.