mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-14 12:46:32 +00:00
Use /info for resolution API (#2136)
This commit is contained in:
parent
7dcb609fd5
commit
7a9aac491e
@ -199,7 +199,7 @@ class RestAPI(CoreSysAttributes):
|
||||
|
||||
self.webapp.add_routes(
|
||||
[
|
||||
web.get("/resolution", api_resolution.base),
|
||||
web.get("/resolution/info", api_resolution.info),
|
||||
web.post(
|
||||
"/resolution/suggestion/{suggestion}",
|
||||
api_resolution.apply_suggestion,
|
||||
|
@ -14,7 +14,7 @@ class APIResoulution(CoreSysAttributes):
|
||||
"""Handle REST API for resoulution."""
|
||||
|
||||
@api_process
|
||||
async def base(self, request: web.Request) -> Dict[str, Any]:
|
||||
async def info(self, request: web.Request) -> Dict[str, Any]:
|
||||
"""Return network information."""
|
||||
return {
|
||||
ATTR_UNSUPPORTED: self.sys_resolution.unsupported,
|
||||
|
@ -44,7 +44,6 @@ NO_SECURITY_CHECK = re.compile(
|
||||
OBSERVER_CHECK = re.compile(
|
||||
r"^(?:"
|
||||
r"|/[^/]+/info"
|
||||
r"|/resolution.*"
|
||||
r")$"
|
||||
)
|
||||
|
||||
@ -95,7 +94,7 @@ ADDONS_ROLE_ACCESS = {
|
||||
r"|/network/.+"
|
||||
r"|/observer/.+"
|
||||
r"|/os/.+"
|
||||
r"|/resolution.*"
|
||||
r"|/resolution/.+"
|
||||
r"|/snapshots.*"
|
||||
r"|/supervisor/.+"
|
||||
r")$"
|
||||
|
@ -24,7 +24,7 @@ async def test_api_resolution_base(coresys: CoreSys, api_client):
|
||||
)
|
||||
coresys.resolution.create_issue(IssueType.FREE_SPACE, ContextType.SYSTEM)
|
||||
|
||||
resp = await api_client.get("/resolution")
|
||||
resp = await api_client.get("/resolution/info")
|
||||
result = await resp.json()
|
||||
assert UnsupportedReason.OS in result["data"][ATTR_UNSUPPORTED]
|
||||
assert (
|
||||
|
Loading…
x
Reference in New Issue
Block a user