Add Reolink PTZ tilt position sensor (#129837)

This commit is contained in:
starkillerOG 2024-11-05 13:39:45 +01:00 committed by GitHub
parent 15bf652f37
commit 4c86102daf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 19 additions and 4 deletions

View File

@ -261,7 +261,10 @@
},
"sensor": {
"ptz_pan_position": {
"default": "mdi:pan"
"default": "mdi:pan-horizontal"
},
"ptz_tilt_position": {
"default": "mdi:pan-vertical"
},
"battery_temperature": {
"default": "mdi:thermometer"

View File

@ -58,7 +58,16 @@ SENSORS = (
state_class=SensorStateClass.MEASUREMENT,
entity_category=EntityCategory.DIAGNOSTIC,
value=lambda api, ch: api.ptz_pan_position(ch),
supported=lambda api, ch: api.supported(ch, "ptz_position"),
supported=lambda api, ch: api.supported(ch, "ptz_pan_position"),
),
ReolinkSensorEntityDescription(
key="ptz_tilt_position",
cmd_key="GetPtzCurPos",
translation_key="ptz_tilt_position",
state_class=SensorStateClass.MEASUREMENT,
entity_category=EntityCategory.DIAGNOSTIC,
value=lambda api, ch: api.ptz_tilt_position(ch),
supported=lambda api, ch: api.supported(ch, "ptz_tilt_position"),
),
ReolinkSensorEntityDescription(
key="battery_percent",

View File

@ -649,6 +649,9 @@
"ptz_pan_position": {
"name": "PTZ pan position"
},
"ptz_tilt_position": {
"name": "PTZ tilt position"
},
"battery_temperature": {
"name": "Battery temperature"
},

View File

@ -118,8 +118,8 @@
'null': 2,
}),
'GetPtzCurPos': dict({
'0': 1,
'null': 1,
'0': 2,
'null': 2,
}),
'GetPtzGuard': dict({
'0': 2,