Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: avoid reflecting back SMOKE_CMONX when changing smart audio #141

Merged
merged 2 commits into from
Jul 4, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/uiprotect/data/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,20 @@
"autoTrackingObjectTypes": convert_smart_types,
} | super().unifi_dict_conversions()

def unifi_dict(
self,
data: dict[str, Any] | None = None,
exclude: set[str] | None = None,
) -> dict[str, Any]:
data = super().unifi_dict(data=data, exclude=exclude)
if audio_types := data.get("audioTypes"):
# SMOKE_CMONX is not supported for audio types
# and should not be sent to the camera
data["audioTypes"] = [

Check warning on line 483 in src/uiprotect/data/devices.py

View check run for this annotation

Codecov / codecov/patch

src/uiprotect/data/devices.py#L483

Added line #L483 was not covered by tests
bdraco marked this conversation as resolved.
Show resolved Hide resolved
t for t in audio_types if t != SmartDetectAudioType.SMOKE_CMONX.value
]
return data


class LCDMessage(ProtectBaseObject):
type: DoorbellMessageType
Expand Down