Skip to content

Commit ad84dd6

Browse files
committed
Add country field to Supervisor options
Add the optional country field to the SupervisorOptions model.
1 parent ff50f52 commit ad84dd6

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

aiohasupervisor/models/supervisor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,4 @@ class SupervisorOptions(Options):
5353
content_trust: bool | None = None
5454
force_security: bool | None = None
5555
auto_update: bool | None = None
56+
country: str | None = None

tests/test_supervisor.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,23 @@ async def test_supervisor_options(
107107
responses.post(f"{SUPERVISOR_URL}/supervisor/options", status=200)
108108
assert (
109109
await supervisor_client.supervisor.set_options(
110-
SupervisorOptions(debug=True, debug_block=True)
110+
SupervisorOptions(debug=True, debug_block=True, country="NL")
111111
)
112112
is None
113113
)
114114
assert responses.requests.keys() == {
115115
("POST", URL(f"{SUPERVISOR_URL}/supervisor/options"))
116116
}
117+
assert (
118+
request := responses.requests[
119+
("POST", URL(f"{SUPERVISOR_URL}/supervisor/options"))
120+
]
121+
)
122+
assert request[0].kwargs["json"] == {
123+
"debug": True,
124+
"debug_block": True,
125+
"country": "NL",
126+
}
117127

118128

119129
async def test_supervisor_repair(

0 commit comments

Comments
 (0)