Skip to content

Commit

Permalink
New amcrest binary sensor to monitor doorbell button (#66302)
Browse files Browse the repository at this point in the history
* New binary sensor to monitor doorbell button

* New binary sensor to monitor doorbell button
  • Loading branch information
PanicRide committed Feb 11, 2022
1 parent 9134e5c commit 0797533
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions homeassistant/components/amcrest/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ class AmcrestSensorEntityDescription(BinarySensorEntityDescription):

_ONLINE_KEY = "online"

_DOORBELL_KEY = "doorbell"
_DOORBELL_NAME = "Doorbell Button"
_DOORBELL_EVENT_CODE = "CallNoAnswered"

BINARY_SENSORS: tuple[AmcrestSensorEntityDescription, ...] = (
AmcrestSensorEntityDescription(
key=_AUDIO_DETECTED_KEY,
Expand Down Expand Up @@ -111,6 +115,12 @@ class AmcrestSensorEntityDescription(BinarySensorEntityDescription):
device_class=BinarySensorDeviceClass.CONNECTIVITY,
should_poll=True,
),
AmcrestSensorEntityDescription(
key=_DOORBELL_KEY,
name=_DOORBELL_NAME,
device_class=BinarySensorDeviceClass.OCCUPANCY,
event_code=_DOORBELL_EVENT_CODE,
),
)
BINARY_SENSOR_KEYS = [description.key for description in BINARY_SENSORS]
_EXCLUSIVE_OPTIONS = [
Expand Down

0 comments on commit 0797533

Please sign in to comment.