File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed
homeassistant/components/onvif Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ async def async_setup_entry(
7070 vol .Optional (ATTR_TILT ): vol .In ([DIR_UP , DIR_DOWN ]),
7171 vol .Optional (ATTR_ZOOM ): vol .In ([ZOOM_OUT , ZOOM_IN ]),
7272 vol .Optional (ATTR_DISTANCE , default = 0.1 ): cv .small_float ,
73- vol .Optional (ATTR_SPEED , default = 0.5 ): cv .small_float ,
73+ vol .Optional (ATTR_SPEED ): cv .small_float ,
7474 vol .Optional (ATTR_MOVE_MODE , default = RELATIVE_MOVE ): vol .In (
7575 [
7676 CONTINUOUS_MOVE ,
@@ -210,10 +210,10 @@ async def _async_get_stream_uri(self) -> str:
210210 async def async_perform_ptz (
211211 self ,
212212 distance ,
213- speed ,
214213 move_mode ,
215214 continuous_duration ,
216215 preset ,
216+ speed = None ,
217217 pan = None ,
218218 tilt = None ,
219219 zoom = None ,
Original file line number Diff line number Diff line change @@ -602,10 +602,11 @@ async def async_perform_ptz(
602602 return
603603
604604 req .PresetToken = preset_val
605- req .Speed = {
606- "PanTilt" : {"x" : speed_val , "y" : speed_val },
607- "Zoom" : {"x" : speed_val },
608- }
605+ if speed_val is not None :
606+ req .Speed = {
607+ "PanTilt" : {"x" : speed_val , "y" : speed_val },
608+ "Zoom" : {"x" : speed_val },
609+ }
609610 await ptz_service .GotoPreset (req )
610611 elif move_mode == STOP_MOVE :
611612 await ptz_service .Stop (req )
Original file line number Diff line number Diff line change 3030 max : 1
3131 step : 0.01
3232 speed :
33- default : 0.5
3433 selector :
3534 number :
3635 min : 0
You can’t perform that action at this time.
0 commit comments