Releases: vale76p/Newlab
Releases · vale76p/Newlab
Release list
v1.3.0
ConfigEntryAuthFailed/ConfigEntryNotReady—async_setup_entrynow raises proper
HA exceptions instead ofreturn False, enabling automatic credential re-prompt and retry UI.- Options flow precedence fix — poll interval is now read from
entry.optionsbefore
entry.data, so a configured override is preserved after integration reload. - Integration tests — 6 async tests with
pytest-homeassistant-custom-componentcovering
setup, auth failure, connection failure, unload, entity creation, and options reload. - HTTP client edge-case tests — 14 new tests covering login failures, HTTP errors, unauthenticated
calls, andensure_authenticated; client.py coverage raised to 91%. - HTML parser contract tests — 40 tests across 9 fixture files covering strategies A/B/C/D,
EN/IT i18n, offline detection, parse errors, and all label resolution fallbacks; parsers.py at 100%. - mypy gradual type checking —
[tool.mypy]section inpyproject.toml; CI blocks on type errors. - Extended ruff rules — added
C4,PIE,RET,TCrule sets. - CI Python matrix —
validate.ymlnow runs on Python 3.11 and 3.12. - Coverage gate — CI fails if total coverage drops below 85%.
release.yml— automated GitHub Release onv*.*.*tags, with manifest version
v1.2.0 — Code Review & Bug Fixes
Fixed
NewlabParseErrormissing fromclient.pyimports — login flow would crash withNameErrorif the welcome page HTML lacked the CSRF token. Re-added the import frommodels.- Silent error swallowing in
set_light()/async_refresh_plant()— restored_LOGGER.warningon non-200 responses and_LOGGER.erroron connection exceptions; added_LOGGER.errorwhen called without authentication. - Reduced observability in
parsers.py— restored per-strategy DEBUG logging, added ERROR log before raisingNewlabParseError, and WARNING logs when system-info fields are not found. - URL comparison in
get_groups()— fixed login-redirect detection to use case-insensitive comparison (HOME_URL.lower()). - Import ordering — fixed
ruff I001violations across coordinator, config_flow, and test modules. - Quoted type annotation — removed unnecessary string quotes from
config_flow.py:async_get_options_flowreturn type (UP037).
Changed
- Shared
DeviceInfovia coordinator —coordinator.hub_device_infoproperty replaces identicalDeviceInfo(…)blocks duplicated inlight.py,number.py,sensor.py, andbutton.py. Entities now delegate toself.coordinator.hub_device_info. - Public parser API — renamed
_parse_groups→parse_groupsand_parse_system_info→parse_system_infoinparsers.py; updatedapi.pyfacade exports and all internal callers. strings.jsonin English — HA convention requiresstrings.jsonin English; Italian translations remain intranslations/it.json.- Ruff lint rules expanded — added
I(isort),B(bugbear),UP(pyupgrade),SIM(simplify). SuppressedUP017(datetime.UTC) for Python 3.9 test compatibility. - Dead constants removed —
CONF_USERNAME,CONF_PASSWORD,DATA_COORDINATOR,DATA_APIremoved fromconst.py(unused after Codex refactor).
Added
- 6 new parser tests — Strategy C (
data-group), Strategy D (broad fallback), L4 (td_text), parse-error (pytest.raises), partial system info, empty HTML. Total parsing tests: 12 (was 6). pytest.raisesidiom — replacedtry/except/raise AssertionErroranti-pattern intest_client.pyandtest_coordinator.py.
Quality
- Ruff lint: 0 errors (was 9).
- Test suite: 31 tests, all passing.
- Coverage: 87% total (was 84%).
parsers.pyandmodels.pyat 100%.
v1.1.1
[v1.0.2a] Fix polling cloud info at load only
update parse info detail only once
[v1.0.2] Minor bug fix + brand logo update
logo update