Skip to content

Commit

Permalink
remove caller info as default
Browse files Browse the repository at this point in the history
  • Loading branch information
pergolafabio committed Jan 2, 2024
1 parent b7caa63 commit a193900
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 18 deletions.
1 change: 0 additions & 1 deletion hikvision-doorbell/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ schema:
username: str
password: str
output_relays: "int?"
caller_info: "bool?"
scenes: "bool?"
system:
log_level: match(^ERROR|WARNING|INFO|DEBUG$)
Expand Down
1 change: 0 additions & 1 deletion hikvision-doorbell/src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ class Doorbell(BaseModel):
username: str
password: str
output_relays: Optional[int] = None # TODO: validate it is in acceppable range!
caller_info: Optional[bool] = False
scenes: Optional[bool] = False

class HomeAssistant(BaseModel):
Expand Down
29 changes: 13 additions & 16 deletions hikvision-doorbell/src/mqtt_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,22 +124,19 @@ def __init__(self, config: AppConfig.MQTT, doorbells: Registry) -> None:
isapi_text = Text(settings, self._isapi_input_callback, doorbell)
isapi_text.set_availability(True)
self._sensors[doorbell]['isapi_text'] = isapi_text

if doorbell._config.caller_info is True:
# Optional: Define a caller_info button to know what indoor station is ringinhg

###########
# Caller_info call button
button_info = ButtonInfo(
name="Caller info",
unique_id=f"{sanitized_doorbell_name}_caller_info",
device=device,
icon="mdi:phone-log",
object_id=f"{sanitized_doorbell_name}_caller_info")
settings = Settings(mqtt=mqtt_settings, entity=button_info, manual_availability=True)
caller_info_button = Button(settings, self._caller_info_callback, doorbell)
caller_info_button.set_availability(True)
self._sensors[doorbell]['caller_info'] = caller_info_button

###########
# Caller_info call button Define a caller_info button to know what indoor station is ringing
button_info = ButtonInfo(
name="Caller info",
unique_id=f"{sanitized_doorbell_name}_caller_info",
device=device,
icon="mdi:phone-log",
object_id=f"{sanitized_doorbell_name}_caller_info")
settings = Settings(mqtt=mqtt_settings, entity=button_info, manual_availability=True)
caller_info_button = Button(settings, self._caller_info_callback, doorbell)
caller_info_button.set_availability(True)
self._sensors[doorbell]['caller_info'] = caller_info_button

if doorbell._config.scenes is True:
# Define scene/alarm buttons for indoor stations: "atHome", "goOut", "goToBed", "custom", and 2 poll sensors
Expand Down

0 comments on commit a193900

Please sign in to comment.