Skip to content

Commit

Permalink
Merge pull request #39 from grische/feature/fallback-domain-configurable
Browse files Browse the repository at this point in the history
make fallback domain configurable
  • Loading branch information
DasSkelett authored Oct 26, 2024
2 parents d743841 + 757e4a2 commit dd6d800
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,5 @@ logging_config:
- console
level: DEBUG
version: 1
fallback_domain: "unifi_respondd_fallback" # optional
```
3 changes: 2 additions & 1 deletion unifi_respondd.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ logging_config:
handlers:
- console
level: DEBUG
version: 1
version: 1
fallback_domain: "unifi_respondd_fallback" # optional
2 changes: 2 additions & 0 deletions unifi_respondd/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class Config:
ssid_regex: str
offloader_mac: Dict[str, str]
nodelist: str
fallback_domain: str

multicast_address: str
multicast_port: int
Expand Down Expand Up @@ -64,6 +65,7 @@ def from_dict(cls, cfg: Dict[str, str]) -> "Config":
ssid_regex=cfg["ssid_regex"],
offloader_mac=cfg["offloader_mac"],
nodelist=cfg["nodelist"],
fallback_domain=cfg.get("fallback_domain", "unifi_respondd_fallback"),
version=cfg["version"],
ssl_verify=cfg["ssl_verify"],
multicast_enabled=cfg["multicast_enabled"],
Expand Down
4 changes: 1 addition & 3 deletions unifi_respondd/unifi_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,7 @@ def get_infos():
gateway6=offloader.get("gateway6", None),
gateway_nexthop=offloader_id,
neighbour_macs=neighbour_macs,
domain_code=offloader.get(
"domain", "ffmuc_unifi_respondd_fallback"
),
domain_code=offloader.get("domain", cfg.fallback_domain),
)
)
return aps
Expand Down

0 comments on commit dd6d800

Please sign in to comment.