From ffb3fc423ec158ef742d8c6a7d35f807301fbb33 Mon Sep 17 00:00:00 2001 From: crosstyan Date: Tue, 13 Jan 2026 14:46:57 +0800 Subject: [PATCH] feat: add zoom_in and zoom_out commands to PTZ command map note: the `API.md` said it's `zoom_in` and `zoom_out` with underscore, while the go ptzCmdMap said it's `zoomin` and `zoomout` with underscore; I choose to support both (or unify them?) --- pkg/service/ptz.go | 2 ++ pkg/service/ptz_test.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/service/ptz.go b/pkg/service/ptz.go index d62a4fa..f858b94 100644 --- a/pkg/service/ptz.go +++ b/pkg/service/ptz.go @@ -15,6 +15,8 @@ var ( "upleft": 10, "zoomin": 16, "zoomout": 32, + "zoom_in": 16, + "zoom_out": 32, } ptzSpeedMap = map[string]uint8{ diff --git a/pkg/service/ptz_test.go b/pkg/service/ptz_test.go index a715a0f..2d56483 100644 --- a/pkg/service/ptz_test.go +++ b/pkg/service/ptz_test.go @@ -159,7 +159,7 @@ func TestPTZCmdMap(t *testing.T) { // 验证所有预定义的命令都存在 expectedCommands := []string{ "stop", "right", "left", "down", "downright", "downleft", - "up", "upright", "upleft", "zoomin", "zoomout", + "up", "upright", "upleft", "zoomin", "zoomout", "zoom_in", "zoom_out", } for _, cmd := range expectedCommands {