Skip to content

Release v2.2.0

Latest

Choose a tag to compare

@github-actions github-actions released this 20 Jun 05:56

Added

  • Test suite: introduced a pytest suite under tests/ running against a real Home Assistant core via pytest-homeassistant-custom-component (pinned in requirements_test.txt, configured in pyproject.toml). Covers the config-flow update-interval coercion (#29) and the number-entity slider range/step logic (#22/#23), with the latter at 100% line coverage. Run with make test / make test-cov; make install now also installs the test dependencies.
  • CLI: analyze output now captures hint (e.g. "48.0~56.0V") and unit for value-type control fields, so contributors debugging number-entity range issues have the API-provided min/max available directly in the analysis JSON. Bumped analysis_version to 3; existing v2 analyses still verify against their own checksum (#22, thanks to @arasuludag for the detailed bug report that exposed the gap).

Fixed

  • Charging-voltage and current number entities now stay usable when the DessMonitor API sends a wrong or missing hint. The slider range used to come straight from the hint, so a bad hint (e.g. 25-30V reported on a 48V system whose live setting is 57.6V) or a missing hint (HA defaulting to 0-100) left the slider unusable and rejected valid number.set_value calls as "out of range". The range is now trusted only when the hint actually brackets the device's current value; otherwise it is synthesized around the live value (floored at 0 for V/A, generous headroom). Since the API rejects genuinely invalid writes, erring wide is safe. The range logic moved to a dependency-free number_range.py helper (#22, thanks to @arasuludag for confirming the API returns the wrong hint and @albertdb for the 12V data point and the "API rejects invalid writes anyway" insight; also resolves the range half of #23 reported by @Dymyk).
  • Unloading a config entry no longer raises KeyError if the coordinator was never stored (e.g. when setup failed partway): async_unload_entry now pops from hass.data defensively and only closes the API session when a coordinator is present.
  • Config flow: selecting an update interval no longer fails with value must be one of [60, 300, 600, 1800, 3600] on submit. The interval dropdown is backed by an integer-keyed vol.In, but the frontend returns the chosen value as a string, so validation rejected every selection and the integration could not be added. The schema now coerces the value to int before the membership check (vol.All(vol.Coerce(int), vol.In(...))) in both the initial setup and the options flow, mirroring Home Assistant core's own idiom (#29, thanks to @Obibokhomie for the detailed report and root-cause analysis, and to @mullerpetr76 and @Rybriz for confirming).
  • Voltage and current number entities (e.g. bulk/floating charging voltage, max charging current) now get a 0.1 step even when the DessMonitor API omits the hint field for that control. Previously the step was only set when a hint was present, so hint-less fields fell back to Home Assistant's default step of 1, making the slider too coarse for voltage adjustments (#23, thanks to @Dymyk for the screenshot showing the entity attributes).