Skip to content

Conversation

@justinh998
Copy link

Breaking change

Proposed change

The average entities are now no longer unavailable if the source sensor(s) are unavailable. This behavior is deactivated by default and must be activated by the user in the configuration.

Additionally, there is now an option for users to calculate the average value up to the last known value of the entity that was not unavailable. If the user ignores unavailable entities, that is the default option as the calculation happens as soon as the entities are unavailable. Alternatively, the user can choose to assume that the last value before unavailability is valid until now and calculate accordingly.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (which adds functionality to an this integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example entry for configuration.yaml:

# Example configuration.yaml
sensor:
  - platform: average
    unique_id: 35806f32-628e-4b98-a9db-20e424ba2b22
    name: 'Effizienz Akku heute gesamt'
    start: "{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}"
    end: "{{ now().replace(hour=23).replace(minute=59).replace(second=59) }}"
    ignore_undef: 1
    calculate_to_now_undef: 1
    entities:
      - sensor.noah_2000_effizenz

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • The code has been formatted using Ruff (python3 -m ruff format custom_components)
  • The code quality has been checked using Ruff (python3 -m ruff check custom_components --fix)

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

  • Documentation added/updated to README.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant