Skip to content

Commit

Permalink
Merge pull request #66 from iviemeister/UAH-DOOR
Browse files Browse the repository at this point in the history
Added UAH-DOOR device_type
  • Loading branch information
imhotep authored Sep 2, 2024
2 parents 9f8d1d3 + 5dcdc56 commit 0db9617
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

# Supported hardware
- Unifi Access Hub (UAH) :white_check_mark:
- Unifi Access Hub (UAH-DOOR) :white_check_mark:
- Unifi Access Hub Enterprise (UAH-Ent) :x: (partial/experimental support)
- Unifi Gate Hub (UGT) :x: (partial/experimental support)
- Unifi Access Ultra :x: (partial/experimental support)
Expand Down
9 changes: 9 additions & 0 deletions custom_components/unifi_access/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,17 +432,26 @@ def _handle_UGT_config_update(self, update, device_type):
changed_doors.append(existing_door)
return changed_doors

def _handle_UNKNOWN_config_update(self, update, device_type):
"""Default handler for unknown hub types"""
_LOGGER.critical("UniFi Access Hub type %s unknown", device_type)
_LOGGER.critical("%s", update)

def _handle_config_update(self, update, device_type):
"""Process config update."""
match device_type:
case "UAH":
return self._handle_UAH_config_update(update, device_type)
case "UAH-DOOR":
return self._handle_UAH_config_update(update, device_type)
case "UAH-Ent":
return self._handle_UAH_Ent_config_update(update, device_type)
case "UA-ULTRA":
return self._handle_UAH_Ent_config_update(update, device_type)
case "UGT":
return self._handle_UGT_config_update(update, device_type)
case _:
return self._handle_UNKNOWN_config_update(update, device_type)

def on_message(self, ws: websocket.WebSocketApp, message): # noqa: C901
"""Handle messages received on the websocket client.
Expand Down

0 comments on commit 0db9617

Please sign in to comment.