Major refactoring bringing some nice quality of life updates
Changes
Warning
This is a major update, read (at least) the breaking changes before hitting that update button!
💥 Breaking Changes
- Update reactive energy sensor (#364) @redlukas
- This lifts the minimum required version of Home Assistant to 2025.6.0, because the unit of reactive energy was only introduced into home assistant in home-assistant/core#143941.
- People on an older release will see a
ImportError: cannot import name 'UnitOfReactiveEnergy' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py)on startup
- refactor the internal handling of sensors (#368)
- This mainly affects how the sensor objects are persisted into the Home Assistant config. This is how Home Assistant knows what sensors exist across restarts.
- Because the refactored config is not compatible with the previous config, users must remove all hubs from the integration page and re-add them when updating from 1.x to 2.x
- If the sensors were not renamed in the WebUI of the M-Bus Center since the last time the integration was added, the sensors will get the same name again and automations etc. will continue to function as normal
- Before removing the previous config by removing the hubs, users will see a
TypeError: the JSON object must be str, bytes or bytearray, not listerror in the logs - The hubs can be removed at any time. The re-add has to happen after the 2.x version of the integration has been loaded by Home assistant.
🚀 Features
- add the emu professional 2 v25 sensor (#351) @redlukas
- Update sensors on startup (#372) @redlukas
- previously you had to wait a minute after a HA restart for the first readings to show up, this is now fixed
- make the sensor show up as unavailable if we cannot fetch from the API (#371) @redlukas
- if one or more sensor(s) cannnot be read, they will now show as "unavailable" (previously they showed as "unknown")
- let the integration start up even if a sensor is absent (#369) @redlukas
- if the integration had been configured with x sensors, but during a later startup not all of those sensors were found, the whole integration would not load.
- setting a more fitting default precision for the frequency (#366) @redlukas
- since many emu meters report the frequency with a 10x scaling factor, it is fitting we report the frequency to the UI with one decimal place
- Update reactive energy sensor (#364) @redlukas
- Ability to startup when a sensor is unknown (#352) @redlukas
- If one sensor connected to the M-Bus Center was of a type that we did not know, the integration would not start up.
- This is now fixed. instead, the integration will print some debugging output.
🐛 Fixes
🏠 Changes to keep up with the Requirements imposed by Home Assistant Core
- Update reactive energy sensor (#364) @redlukas
- set the correct device class for reactive power sensors (#363) @redlukas
- set the correct device class for apparent power sensors (#362) @redlukas
- registering the integration domain with HAs logging facility (#360) @redlukas
📚 Documentation
🔨 Refactoring
- Reading the sensors completely asynchronously (#373) @redlukas
- make the _extract_values method static (#370) @redlukas
- Switch to ruff (#354) @redlukas
💄 Style
- exclude main from precommit check (#356) @redlukas
- ruff formatting (#355) @redlukas
- Switch to ruff (#354) @redlukas
📦 Dependencies
- Bump ruff from 0.12.1 to 0.12.2 in /.github/workflows (#374) @dependabot[bot]
- Bump ruff from 0.12.0 to 0.12.1 in /.github/workflows (#367) @dependabot[bot]
- Bump ruff from 0.11.13 to 0.12.0 in /.github/workflows (#361) @dependabot[bot]
- Bump ruff from 0.11.12 to 0.11.13 in /.github/workflows (#359) @dependabot[bot]
- Bump ruff from 0.11.11 to 0.11.12 in /.github/workflows (#358) @dependabot[bot]
- Bump release-drafter/release-drafter from 6.0.0 to 6.1.0 (#340) @dependabot[bot]
- Bump crazy-max/ghaction-github-labeler from 5.0.0 to 5.3.0 (#341) @dependabot[bot]
- Bump actions/setup-python from 5.2.0 to 5.6.0 (#347) @dependabot[bot]
- Bump actions/checkout from 4.2.1 to 4.2.2 (#311) @dependabot[bot]