How to implement Significant Change Support for Entity Integrations

Hey all,
i am working on an integration which polls high frequently a device API to get the current sensor values and populate them to HA.

I plan to implement Significant Change Support as documented here

After execution of python3 -m script.scaffold significant_change two files has been created

//platform-folder/significant_change.py
//test-paltform-folder/test_significant_change.py

As mentioned in the docs in significant_change.py it should be checked if changes are significant and depending on the boolean response the entity should get updated (or not)

However even if I put a simple “Return False” in the signifcant_change.py the values gets updated all the time. I also put there a breakpoint in the debugger and saw this code never get called.

Do you have an idea what’s needed to get this signifcant_change_function be called? Please find below the current content of the significant_change.py

"""Helper to test significant Binary Sensor state changes."""
from __future__ import annotations

from typing import Any

from homeassistant.core import HomeAssistant, callback


@callback
def async_check_significant_change(
    hass: HomeAssistant,
    old_state: str,
    old_attrs: dict,
    new_state: str,
    new_attrs: dict,
    **kwargs: Any,
) -> bool | None:
    """Test if state significantly changed."""
    return False

If I understand correctly the goal (Add "significant change" base by balloob · Pull Request #45555 · home-assistant/core · GitHub), the idea is not to “filter” states, but to allow other integrations to call this function to determine if the state change is worth to be handled.

So, an integration will read this value. I’m not sure any actually do, currently.

ahhh, i see - got it. Thank you