Skip to content

Commit

Permalink
Merge pull request #10 from azogue/chore/maintenance
Browse files Browse the repository at this point in the history
📦️ Fix import of `DeviceInfo` after HA-Core v2023.9
  • Loading branch information
azogue authored Aug 19, 2023
2 parents 9c0dd5e + 0d6c8b7 commit 1d26eb9
Show file tree
Hide file tree
Showing 6 changed files with 624 additions and 611 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.281
rev: v0.0.285
hooks:
- id: ruff
args:
Expand Down Expand Up @@ -32,7 +32,7 @@ repos:
- id: check-json
exclude: (.vscode|.devcontainer)
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0
rev: v3.0.2
hooks:
- id: prettier
- repo: https://github.com/cdce8p/python-typing-update
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [v1.1.1](https://github.com/azogue/ha-pvpc-custom/tree/v1.1.1) 📦️ (MAINTENANCE) Fix import of `DeviceInfo` after HA v2023.9.0 (2023-08-19)

- 🐛 Fix future `ImportError` for `DeviceInfo` migrating to 'device_registry', scheduled for next HA-Core version 2023.9
- 📦️ Upgrade required Python to 3.11 and enable usage with 3.12, syncing with HA-Core reqs
- 🎨 pre-commit autoupdate

## [v1.1.0](https://github.com/azogue/ha-pvpc-custom/tree/v1.1.0) 🐛 Fixes for new extra price sensors (2023-05-29)

- 🐛 Fix all integration sensors going unavailable when any sensor lacks data for the current day (usually the 'OMIE price')
Expand Down
4 changes: 2 additions & 2 deletions custom_components/pvpc_hourly_pricing/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"issue_tracker": "https://github.com/azogue/ha-pvpc-custom/issues",
"loggers": ["aiopvpc"],
"quality_scale": "platinum",
"requirements": ["aiopvpc==4.2.1"],
"version": "1.1.0"
"requirements": ["aiopvpc>=4.2.1"],
"version": "1.1.1"
}
7 changes: 6 additions & 1 deletion custom_components/pvpc_hourly_pricing/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@
from homeassistant.const import CONF_NAME, CURRENCY_EURO, UnitOfEnergy
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.device_registry import DeviceEntryType
from homeassistant.helpers.entity import DeviceInfo

try:
from homeassistant.helpers.entity import DeviceInfo
except ImportError: # after ha-core#98149
from homeassistant.helpers.device_registry import DeviceInfo

from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.event import async_track_time_change
from homeassistant.helpers.typing import StateType
Expand Down
Loading

0 comments on commit 1d26eb9

Please sign in to comment.