Skip to content

Commit

Permalink
Added event_score_humand and event_score_vehicle Threshold setting fo…
Browse files Browse the repository at this point in the history
…r Human / Vehicle classification to reduce false positives? #38
  • Loading branch information
briis committed Apr 18, 2022
1 parent 96e0808 commit 773890d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
6 changes: 4 additions & 2 deletions custom_components/securityspy/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
from .const import (
ATTR_EVENT_LENGTH,
ATTR_EVENT_OBJECT,
ATTR_EVENT_SCORE,
ATTR_EVENT_SCORE_HUMAN,
ATTR_EVENT_SCORE_VEHICLE,
DOMAIN,
)
from .entity import SecuritySpyEntity
Expand Down Expand Up @@ -121,7 +122,8 @@ def extra_state_attributes(self):
ATTR_LAST_TRIP_TIME: self._device_data["last_motion"],
ATTR_EVENT_LENGTH: self._device_data["event_length"],
ATTR_EVENT_OBJECT: self._device_data["event_object"],
ATTR_EVENT_SCORE: self._device_data["event_score"],
ATTR_EVENT_SCORE_HUMAN: self._device_data["event_score_human"],
ATTR_EVENT_SCORE_VEHICLE: self._device_data["event_score_vehicle"],
}
return {
**super().extra_state_attributes,
Expand Down
3 changes: 2 additions & 1 deletion custom_components/securityspy/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
ATTR_BRAND = "brand"
ATTR_EVENT_LENGTH = "event_length"
ATTR_EVENT_OBJECT = "event_object"
ATTR_EVENT_SCORE = "event_score"
ATTR_EVENT_SCORE_HUMAN = "event_score_human"
ATTR_EVENT_SCORE_VEHICLE = "event_score_vehicle"
ATTR_PRESET_ID = "preset_id"
ATTR_PTZ_CAPABILITIES = "ptz_capabilities"

Expand Down
6 changes: 4 additions & 2 deletions custom_components/securityspy/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
from .entity import SecuritySpyEntity

from .const import (
ATTR_EVENT_SCORE,
ATTR_EVENT_SCORE_HUMAN,
ATTR_EVENT_SCORE_VEHICLE,
DEVICE_CLASS_DETECTION,
DOMAIN,
RECORDING_TYPE_ACTION,
Expand Down Expand Up @@ -130,7 +131,8 @@ def extra_state_attributes(self):
if self._description.device_type == DEVICE_CLASS_DETECTION:
return {
**super().extra_state_attributes,
ATTR_EVENT_SCORE: self._device_data["event_score"],
ATTR_EVENT_SCORE_HUMAN: self._device_data["event_score_human"],
ATTR_EVENT_SCORE_VEHICLE: self._device_data["event_score_vehicle"],
}
return {
**super().extra_state_attributes,
Expand Down

0 comments on commit 773890d

Please sign in to comment.