@@ -37,6 +37,7 @@ class FoscamDeviceInfo:
3737 supports_speak_volume_adjustment : bool
3838 supports_pet_adjustment : bool
3939 supports_car_adjustment : bool
40+ supports_human_adjustment : bool
4041 supports_wdr_adjustment : bool
4142 supports_hdr_adjustment : bool
4243
@@ -144,24 +145,32 @@ def gather_all_configs(self) -> FoscamDeviceInfo:
144145 if ret_sw == 0
145146 else False
146147 )
147- ret_md , mothion_config_val = self .session .get_motion_detect_config ()
148+ human_adjustment_val = (
149+ bool (int (software_capabilities .get ("swCapabilities2" )) & 128 )
150+ if ret_sw == 0
151+ else False
152+ )
153+ ret_md , motion_config_val = self .session .get_motion_detect_config ()
148154 if pet_adjustment_val :
149155 is_pet_detection_on_val = (
150- mothion_config_val [ "petEnable" ] == "1" if ret_md == 0 else False
156+ motion_config_val . get ( "petEnable" ) == "1" if ret_md == 0 else False
151157 )
152158 else :
153159 is_pet_detection_on_val = False
154160
155161 if car_adjustment_val :
156162 is_car_detection_on_val = (
157- mothion_config_val [ "carEnable" ] == "1" if ret_md == 0 else False
163+ motion_config_val . get ( "carEnable" ) == "1" if ret_md == 0 else False
158164 )
159165 else :
160166 is_car_detection_on_val = False
161167
162- is_human_detection_on_val = (
163- mothion_config_val ["humanEnable" ] == "1" if ret_md == 0 else False
164- )
168+ if human_adjustment_val :
169+ is_human_detection_on_val = (
170+ motion_config_val .get ("humanEnable" ) == "1" if ret_md == 0 else False
171+ )
172+ else :
173+ is_human_detection_on_val = False
165174
166175 return FoscamDeviceInfo (
167176 dev_info = dev_info ,
@@ -179,6 +188,7 @@ def gather_all_configs(self) -> FoscamDeviceInfo:
179188 supports_speak_volume_adjustment = supports_speak_volume_adjustment_val ,
180189 supports_pet_adjustment = pet_adjustment_val ,
181190 supports_car_adjustment = car_adjustment_val ,
191+ supports_human_adjustment = human_adjustment_val ,
182192 supports_hdr_adjustment = supports_hdr_adjustment_val ,
183193 supports_wdr_adjustment = supports_wdr_adjustment_val ,
184194 is_open_wdr = is_open_wdr ,
0 commit comments