Skip to content

Commit

Permalink
fix: coordinator api access
Browse files Browse the repository at this point in the history
  • Loading branch information
EuleMitKeule committed Feb 27, 2023
1 parent a117e23 commit 56a536e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM python:3.9

WORKDIR /app

COPY ./requirements.txt /app/requirements.txt

RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt

COPY ./estimenergy /app/estimenergy

CMD ["uvicorn", "estimenergy.main:app", "--host", "0.0.0.0", "--port", "80", "--log-config", "logging.conf"]
2 changes: 1 addition & 1 deletion hass/custom_components/estimenergy/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ def __init__(self, hass: HomeAssistant, name: str, host: str, port: int) -> None

async def _async_update_data(self):
"""Refresh data from API."""
return await self.client.async_get_data(self.name)
return await self.hass.async_add_executor_job(self.client.get_data, self.name)
2 changes: 1 addition & 1 deletion hass/custom_components/estimenergy/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"documentation": "https://github.com/EuleMitKeule/EstimEnergy",
"iot_class": "local_polling",
"issue_tracker": "https://github.com/EuleMitKeule/EstimEnergy/issues",
"requirements": ["estimenergy-client"]
"requirements": ["estimenergy-client>=0.2.0"]
}

0 comments on commit 56a536e

Please sign in to comment.