Reorganize HTTP component (#4575)
* Move HTTP to own folder * Break HTTP into middlewares * Lint * Split tests per middleware * Clean up HTTP tests * Make HomeAssistantViews more stateless * Lint * Make HTTP setup async
This commit is contained in:
1 parent
58b85b2e0e
commit
32ffd006fa
35 files changed
+1318
-1084
No files matched your search
@@ -97,6 +97,7 @@ class NetioApiView(HomeAssistantView):
|
||||
@callback
|
||||
def get(self, request, host):
|
||||
"""Request handler."""
|
||||
hass = request.app['hass']
|
||||
data = request.GET
|
||||
states, consumptions, cumulated_consumptions, start_dates = \
|
||||
[], [], [], []
|
||||
@@ -119,7 +120,7 @@ class NetioApiView(HomeAssistantView):
|
||||
ndev.start_dates = start_dates
|
||||
|
||||
for dev in DEVICES[host].entities:
|
||||
self.hass.async_add_job(dev.async_update_ha_state())
|
||||
hass.async_add_job(dev.async_update_ha_state())
|
||||
|
||||
return self.json(True)
|
||||
|
||||
|
||||
Reference in new issue
Block a user