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": { "sensor": {
"ptz_pan_position": { "ptz_pan_position": {
"default": "mdi:pan" "default": "mdi:pan-horizontal"
},
"ptz_tilt_position": {
"default": "mdi:pan-vertical"
}, },
"battery_temperature": { "battery_temperature": {
"default": "mdi:thermometer" "default": "mdi:thermometer"

View File

@ -58,7 +58,16 @@ SENSORS = (
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
value=lambda api, ch: api.ptz_pan_position(ch), 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( ReolinkSensorEntityDescription(
key="battery_percent", key="battery_percent",

View File

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

View File

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