async def significant_change(
        self,
        switch: AdaptiveSwitch,
        light: str,
        adapt_brightness: bool,
        adapt_color: bool,
        context: Context,  # just for logging
    ) -> bool:
        """Has the light made a significant change since last update.

        This method will detect changes that were made to the light without
        calling 'light.turn_on', so outside of Home Assistant. If a change is
        detected, we mark the light as 'manually controlled' until the light
        or switch is turned 'off' and 'on' again.
        """
        assert switch._detect_non_ha_changes

        last_service_data = self.last_service_data.get(light)
        if last_service_data is None:
            return False
        # Update state and check for a manual change not done in HA.
        # Ensure HASS is correctly updating your light's state with
        # light.turn_on calls if any problems arise. This
        # can happen e.g. using zigbee2mqtt with 'report: false' in device settings.
        await async_update_entity(self.hass, light)
        refreshed_state = self.hass.states.get(light)
        assert refreshed_state is not None

        changed = _attributes_have_changed(
            old_attributes=last_service_data,
            new_attributes=refreshed_state.attributes,
            light=light,
            adapt_brightness=adapt_brightness,
            adapt_color=adapt_color,
            context=context,
        )
        if changed:
            _LOGGER.debug(
                "%s: State attributes of '%s' changed (%s) wrt 'last_service_data' (%s) (context.id=%s)",
                switch._name,
                light,
                refreshed_state.attributes,
                last_service_data,
                context.id,
            )
            return True
        _LOGGER.debug(
            "%s: State attributes of '%s' did not change (%s) wrt 'last_service_data' (%s) (context.id=%s)",
            switch._name,
            light,
            refreshed_state.attributes,
            last_service_data,
            context.id,
        )
        return False
Has the light made a significant change since last update.

        This method will detect changes that were made to the light without
        calling 'light.turn_on', so outside of Home Assistant. If a change is
        detected, we mark the light as 'manually controlled' until the light
        or switch is turned 'off' and 'on' again.
        
custom_components/adaptive_lighting/switch.py