observer: first check if full access path contains private or protected attributes

As protected and private attributes are not stored in the cache, it does not make sense to
compare the cached value against the new value.
This commit is contained in:
Mose Müller 2024-07-04 17:25:18 +02:00
parent 218dab1ade
commit cddb83451a

View File

@ -37,8 +37,9 @@ class DataServiceObserver(PropertyObserver):
)
cached_value = cached_value_dict.get("value")
if cached_value != dump(value)["value"] and all(
part[0] != "_" for part in full_access_path.split(".")
if (
all(part[0] != "_" for part in full_access_path.split("."))
and cached_value != dump(value)["value"]
):
logger.debug("'%s' changed to '%s'", full_access_path, value)