Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
python-version: "3.14"
cache: "pip"

- name: Install dependencies
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [0.6.0] - 2026-07-30

### Added
- **Battery pack sensors**: Exposes battery voltage in volts, signed battery current in amperes, calculated battery power in watts, and battery temperature in degrees Celsius when supported by the device TSL. Battery power is positive while charging and negative while discharging.

### Changed
- Battery voltage defaults to two decimal places and battery power defaults to one decimal place in Home Assistant displays.
- Upgraded to unofficial-pecron-api v0.4.1 (adds `eco_onoff_us` as an alternate property code for Eco Silent Mode on some device models)
- Tested and developed against Home Assistant 2026.7.4 (up from 2024.1.0); raised the declared minimum supported version to 2024.11.0
- `DataUpdateCoordinator` now passes `config_entry` explicitly instead of relying on the deprecated ContextVar lookup, which Home Assistant 2026.8 turns into a hard failure

### Fixed
- Read battery voltage, current, and temperature from the nested battery packet exposed by the Pecron API and discover all three sensors through its `host_packet_data_jdb` TSL property.
Expand Down
6 changes: 5 additions & 1 deletion custom_components/pecron/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
entry.data.get(CONF_REFRESH_INTERVAL, DEFAULT_REFRESH_INTERVAL),
)

coordinator = PecronDataUpdateCoordinator(hass, email, password, region, refresh_interval)
coordinator = PecronDataUpdateCoordinator(
hass, entry, email, password, region, refresh_interval
)

# Attempt initial refresh with retry logic
max_retries = 3
Expand Down Expand Up @@ -273,6 +275,7 @@ class PecronDataUpdateCoordinator(DataUpdateCoordinator):
def __init__(
self,
hass: HomeAssistant,
config_entry: ConfigEntry,
email: str,
password: str,
region: str,
Expand All @@ -289,6 +292,7 @@ def __init__(
super().__init__(
hass,
_LOGGER,
config_entry=config_entry,
name=DOMAIN,
update_interval=timedelta(seconds=refresh_interval),
)
Expand Down
4 changes: 2 additions & 2 deletions custom_components/pecron/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"requirements": [
"unofficial-pecron-api>=0.4.1"
],
"version": "0.5.0",
"version": "0.6.0",
"iot_class": "cloud_polling",
"homeassistant": {
"minimum_version": "2024.1.0"
"minimum_version": "2024.11.0"
}
}
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "homeassistant.*"
ignore_missing_imports = true
follow_imports = "skip"

[tool.pytest.ini_options]
testpaths = ["tests"]
Expand Down
4 changes: 2 additions & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ruff==0.1.14
mypy==1.8.0
mypy==1.15.0
pytest==7.4.4
pytest-cov==4.1.0
pytest-asyncio==0.23.2
pre-commit==3.6.0
homeassistant==2024.1.0
homeassistant==2026.7.4
types-aiofiles==23.2.0.20240106
unofficial-pecron-api==0.4.1
Loading
Loading