From 7092c79b5693b239fec739c181d300301c434d22 Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Tue, 27 Feb 2024 00:01:50 +0300 Subject: some include magic; add tools/ipcam_stream.py --- include/py/homekit/camera/types.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/py/homekit/camera/types.py b/include/py/homekit/camera/types.py index aa35ebf..5db4961 100644 --- a/include/py/homekit/camera/types.py +++ b/include/py/homekit/camera/types.py @@ -25,16 +25,16 @@ class CameraType(Enum): elif channel == 2: if self.is_hikvision(): return '/Streaming/Channels/2' - elif self.value == CameraType.XMEYE: + elif self.is_xmeye(): return '/?stream=1.sdp' else: raise ValueError(f'unsupported camera type {self.value}') def get_codec(self, channel: int) -> VideoCodecType: if channel == 1: - return VideoCodecType.H264 if self.value == CameraType.HIKVISION_264 else VideoCodecType.H265 + return VideoCodecType.H264 if self == CameraType.HIKVISION_264 else VideoCodecType.H265 elif channel == 2: - return VideoCodecType.H265 if self.value == CameraType.XMEYE else VideoCodecType.H264 + return VideoCodecType.H265 if self == CameraType.XMEYE else VideoCodecType.H264 else: raise ValueError(f'unexpected channel {channel}') -- cgit v1.2.3