Skip to content

Commit

Permalink
Add detection type to more models. (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
RenierM26 authored Feb 3, 2025
1 parent 707fa6b commit 2f37a17
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
16 changes: 16 additions & 0 deletions custom_components/ezviz_cloud/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,22 @@ class EzvizSelectEntityDescription(SelectEntityDescription):
serial,
value: ezviz_client.set_detection_mode(serial, value),
),
EzvizSelectEntityDescription(
key="advanced_detect_human_car",
translation_key="advanced_detect_human_car",
entity_category=EntityCategory.CONFIG,
options=[
"advanced_detect_human_shape",
"advanced_detect_image_change",
],
supported_ext_key=str(SupportExt.SupportDetectHumanCar.value),
supported_ext_value=["2"],
option_range=[1, 3],
get_current_option=lambda data: data["Alarm_DetectHumanCar"],
set_current_option=lambda ezviz_client,
serial,
value: ezviz_client.set_detection_mode(serial, value),
),
)


Expand Down
7 changes: 7 additions & 0 deletions custom_components/ezviz_cloud/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@
"advanced_detect_human_shape": "Human shape",
"advanced_detect_pir": "Pir"
}
},
"advanced_detect_human_car": {
"name": "Detection mode",
"state": {
"advanced_detect_human_shape": "Human shape",
"advanced_detect_image_change": "Image change"
}
}
},
"image": { "last_motion_image": { "name": "Last motion image" } },
Expand Down
7 changes: 7 additions & 0 deletions custom_components/ezviz_cloud/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@
"advanced_detect_human_shape": "Human shape",
"advanced_detect_pir": "Pir"
}
},
"advanced_detect_human_car": {
"name": "Detection mode",
"state": {
"advanced_detect_human_shape": "Human shape",
"advanced_detect_image_change": "Image change"
}
}
},
"sensor": {
Expand Down

0 comments on commit 2f37a17

Please sign in to comment.