core icon indicating copy to clipboard operation
core copied to clipboard

evohome: code quality, edge-case fixes

Open zxdavb opened this issue 1 year ago • 2 comments

Proposed change

The integration has the following changes:

  • improved features (can handle renaming of heating zone from outside HA)
  • handling edge cases (can't retrieve min/max setpoint from vendor) that would have been bugs
  • less logging (some library errors are logged only once per 24h)
  • more logging (library now warns of active faults - e.g. controller has a flat battery)
  • improved exception handling (e.g. invalid schedule returned from vendor)
  • improved mypy typing (ready for voluptuous 0.14.x)
  • code quality improvements (walrus, etc.)

Here is an example of the active fault logging (these 'occur' every sync_cycle, but are logged only once per 24h):

2024-01-08 21:52:08.278 WARNING (MainThread) [evohomeasync2] 
  Active fault: 3933910 (domesticHotWater): DHWSensorCommunicationLost, 
  since 2024-01-03T20:20:45

See also: https://github.com/zxdavb/evohome-async/compare/0.4.15...0.4.17

Type of change

  • [x] Dependency upgrade
  • [x] Bugfix (non-breaking change which fixes an issue)
  • [ ] New integration (thank you!)
  • [x] New feature (which adds functionality to an existing integration)
  • [ ] Deprecation (breaking change to happen in the future)
  • [ ] Breaking change (fix/feature causing existing functionality to break)
  • [x] Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • [x] The code change is tested and works locally.
  • [x] Local tests pass. Your PR cannot be merged unless tests pass
  • [x] There is no commented out code in this PR.
  • [x] I have followed the development checklist
  • [x] I have followed the perfect PR recommendations
  • [x] The code has been formatted using Ruff (ruff format homeassistant tests)
  • [x] Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • [x] The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • [x] New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • [x] For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • [x] Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

zxdavb avatar Jan 08 '24 21:01 zxdavb

I need to make a small change:

if (temp := self._evo_broker.temps.get(self._evo_id)) is not None:
    # use high-precision temps if available
    return temp

zxdavb avatar Jan 09 '24 15:01 zxdavb

Please avoid making "a little bit of everything" PRs. Create one PR for each type of change.

MartinHjelmare avatar Jan 09 '24 15:01 MartinHjelmare

Please adjust the PR title to the latest changes. Start with a verb in imperative mood.

MartinHjelmare avatar Jan 16 '24 22:01 MartinHjelmare