Skip to content

v1.15.3: coordinator refactor + CI/test-suite cleanup

Choose a tag to compare

@pvyleta pvyleta released this 23 Apr 22:11

Maintenance release — no behavior changes

v1.15.3 is a pure refactor + CI/test-suite cleanup. If v1.15.2 is working for you, upgrading to v1.15.3 will change nothing visible in Home Assistant.

Code organization

  • const.py: collapsed three override tables (STATUS_XML_DESCRIPTOR, HIDDEN_SWITCHES, HIDDEN_BINARY_SENSORS) into a single DESCRIPTOR_OVERRIDES dict applied once at descriptor-load time. The three named subsets remain as the semantic source-of-truth for readability and test imports.
  • entity_helpers.py (new): pure functions extracted from coordinator.pyformat_entity_id_suffix, normalize_property_name, infer_entity_type_from_attributes, lookup_with_normalized_fallback. No Home Assistant imports; unit-testable in any environment.
  • value_writer.py (new): resolve_property() encapsulates the four-method entity_id → XCC prop resolution chain that was inline in async_set_entity_value. Returns a PropResolution dataclass for clean error logging.
  • sensor.py: dropped the duplicated _format_entity_id_suffix; uses the shared helper.
  • coordinator.py: 1061 → 905 lines. Removed the hardcoded _LOGGER.setLevel(logging.DEBUG) that forced verbose logging regardless of HA's logger: config.

Test suite

  • tests/conftest.py pre-caches the stdlib select/selectors modules so the local custom_components/xcc/select.py platform can no longer shadow them during test collection.
  • Twelve test files cleaned up: sys.path.insert hacks removed and replaced with pytest.importorskip("homeassistant") so the suite runs (and skips appropriately) without HA installed.
  • Five obsolete test files deleted: verify_device_assignment_fix.py, test_why_tests_pass_but_integration_fails.py, test_date_fix_minimal.py, test_language_preference_integration.py, test_status_xml_parsing.py.
  • test_xcc_prefix_formatting.py now exercises the real helper via importlib instead of re-implementing it inline.

CI

  • Replaced two duplicated workflows with a single consolidated .github/workflows/ci.yml running on push / PR / release / manual dispatch with concurrency cancellation.
  • Jobs: ruff lint, compileall syntax check, unit tests on Python 3.11/3.12/3.13 without HA, full suite on 3.12 with HA + coverage, and a release-only manifest-version check.

Verification

84 passed, 29 skipped in 143s

(29 skipped locally are HA-dependent and run in the test-ha CI job.)