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

Add system managed fields #28

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions aiohasupervisor/models/addons.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,8 @@ class InstalledAddonComplete(
ip_address: IPv4Address
watchdog: bool
devices: list[str]
system_managed: bool
system_managed_config_entry: str | None


@dataclass(frozen=True, slots=True)
Expand Down
4 changes: 3 additions & 1 deletion tests/fixtures/addons_info.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@
"version": "9.14.0",
"update_available": false,
"watchdog": false,
"devices": []
"devices": [],
"system_managed": false,
"system_managed_config_entry": null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Side note: It would be good to exercise all the optional parameters with an argument that is not null with additional test fixtures and parametrized tests.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok yea Ill put that on the todo list, makes sense

}
}
2 changes: 2 additions & 0 deletions tests/test_addons.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ async def test_addons_info(
assert "not_real" in addon.privileged
assert addon.supervisor_api is True
assert addon.supervisor_role == SupervisorRole.MANAGER
assert addon.system_managed is False
assert addon.system_managed_config_entry is None


async def test_addons_uninstall(
Expand Down
Loading