8000
Skip to content

[sensor] Extend timeout filter with option to return last value received - #10115

Merged
kbx81 merged 6 commits into
esphome:devfrom
kbx81:20250807-add-timeout-filter-last-value
Aug 11, 2025
Merged

[sensor] Extend timeout filter with option to return last value received#10115
kbx81 merged 6 commits into
esphome:devfrom
kbx81:20250807-add-timeout-filter-last-value

Conversation

@kbx81
@kbx81 kbx81 commented Aug 7, 2025
Copy link
Copy Markdown
Member

What does this implement/fix?

Small addition to the timeout filter to return the last value received.

This is useful when the timeout filter is placed ahead of a throttle filter to ensure the last value received will pass through the throttle.

Also corrects THROTTLE_WITH_PRIORITY_SCHEMA schema name.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code quality improvements to existing code or addition of tests
  • Other

Related issue or feature (if applicable):

  • fixes

Pull request in esphome-docs with documentation (if applicable):

Test Environment

  • ESP32
  • ESP32 IDF
  • ESP8266
  • RP2040
  • BK72xx
  • RTL87xx
  • nRF52840

Example entry for config.yaml:

# Example config.yaml

Checklist:

  • The code change is tested and works locally.
  • Tests have been added to verify that the new code works (under tests/ folder).

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

@kbx81
kbx81 requested a review from a team as a code owner August 7, 2025 06:56
@github-actions
github-actions Bot commented Aug 7, 2025
Copy link
Copy Markdown
Contributor

To use the changes from this PR as an external component, add the following to your ESPHome configuration YAML file:

external_components:
  - source: github://pr#10115
    components: [sensor]
    refresh: 1h

(Added by the PR bot)

@codecov-commenter
codecov-commenter commented Aug 7, 2025
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.21%. Comparing base (676c51f) to head (5c60666).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev   #10115   +/-   ##
=======================================
  Coverage   60.21%   60.21%           
=======================================
  Files          51       51           
  Lines       10375    10375           
  Branches     1381     1381           
=======================================
  Hits         6247     6247           
  Misses       3772     3772           
  Partials      356      356           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@esphome esphome Bot added the has-tests label Aug 7, 2025
@esphome esphome Bot removed the small-pr PR < 30 lines label Aug 11, 2025
@kbx81
kbx81 merged commit 45b88f2 into esphome:dev Aug 11, 2025
42 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

0