Skip to content

Commit

Permalink
chore: library update (#86)
Browse files Browse the repository at this point in the history
* chore: library update

* add missing requirements

* add a little more debugging messages

* formatting and linting
  • Loading branch information
firstof9 authored Dec 8, 2024
1 parent 621081e commit f3784d2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ __pycache__
pythonenv*
.coverage
coverage.xml
.storage
4 changes: 4 additions & 0 deletions custom_components/openei/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ async def _async_update_data(self) -> dict:
except AssertionError:
pass
except Exception as exception:
_LOGGER.debug("Exception: %s", exception)
raise UpdateFailed() from exception
return self._data

Expand All @@ -109,13 +110,15 @@ async def _async_refresh_data(self, data=None) -> None:
except AssertionError:
pass
except Exception as exception:
_LOGGER.debug("Exception: %s", exception)
raise UpdateFailed() from exception

async def get_sensors(self) -> dict:
"""Update sensor data."""
api = self._config.data.get(CONF_API_KEY)
plan = self._config.data.get(CONF_PLAN)
meter = self._config.data.get(CONF_SENSOR)
cache_file = f".storage/openei_{self._config.entry_id}"
reading = None

if self._config.data.get(CONF_MANUAL_PLAN):
Expand All @@ -134,6 +137,7 @@ async def get_sensors(self) -> dict:
api=api,
plan=plan,
reading=reading,
cache_file=cache_file,
)
if self._rate_limit_count == 0:
try:
Expand Down
2 changes: 1 addition & 1 deletion custom_components/openei/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"documentation": "https://github.com/firstof9/ha-openei",
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/firstof9/ha-openei/issues",
"requirements": ["python-openei==0.2.0"],
"requirements": ["python_openei==0.2.3", "aiofiles"],
"version": "0.1.6"
}
5 changes: 3 additions & 2 deletions requirements_tests.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-r requirements_dev.txt
python-openei==0.2.0
python_openei==0.2.3
pytest
pytest-cov
pytest-homeassistant-custom-component
Expand All @@ -10,4 +10,5 @@ mypy
pydocstyle
isort
pylint
aioresponses
aioresponses
aiofiles

0 comments on commit f3784d2

Please sign in to comment.