(self, entity_id: str, attr: str, value: Any)
Cache entity's attribute value to disk.
Cache entity's attribute value to disk.
Cache entity s attribute value to disk .
def save_attr_value(self, entity_id: str, attr: str, value: Any):
        """Cache entity's attribute value to disk."""
        if entity_id not in self._data[STORE_CACHE_ATTRS]:
            self._data[STORE_CACHE_ATTRS][entity_id] = {}
            has_changed = True
        else:
            has_changed = self._data[STORE_CACHE_ATTRS][entity_id][attr] != value

        self._data[STORE_CACHE_ATTRS][entity_id][attr] = value

        if has_changed:
            self._store.async_delay_save(lambda: self._data, 5.0)
def save_attr_value ( self , entity_id : str , attr : str , value : Any ) : if entity_id not in self . _data [ STORE_CACHE_ATTRS ] : self . _data [ STORE_CACHE_ATTRS ] [ entity_id ] = { } has_changed = True else : has_changed = self . _data [ STORE_CACHE_ATTRS ] [ entity_id ] [ attr ] != value self . _data [ STORE_CACHE_ATTRS ] [ entity_id ] [ attr ] = value if has_changed : self . _store . async_delay_save ( lambda : self . _data , 5.0 )