Skip to content

Commit

Permalink
Update integration.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Noltari committed Oct 26, 2023
1 parent 0af0e9c commit a082161
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sim/integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import Any

from aiohttp import web
from helpers import api_json_response
from helpers import api_filter_dict, api_json_response

from aioairzone.const import API_DRIVER

Expand All @@ -29,8 +29,12 @@ async def put(self, request: web.Request) -> Any:
"""PUT Local API Integration."""
data = await request.json()
if type(data) is dict:
keys = data.keys() + [API_SYSTEM_ID]

driver = data.get(API_DRIVER)
if driver is not None:
self.driver = data[API_DRIVER]

return api_json_response(api_filter_dict(self.data(), data.keys()))
return api_json_response(api_filter_dict(self.data(), keys))

return api_json_response(self.data())

0 comments on commit a082161

Please sign in to comment.