File tree 2 files changed +14
-8
lines changed
custom_components/studer_xcom
2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -441,19 +441,25 @@ async def _async_read_cache(self):
441
441
store = await self ._store .async_get_data () or {}
442
442
self ._cache = store .get ("cache" , {})
443
443
else :
444
- _LOGGER .warning (f"Using empty cache; no store available to read persisted cache from" )
444
+ _LOGGER .warning (f"Using empty cache; no store available to read from" )
445
445
self ._cache = {}
446
446
447
447
448
448
async def _async_persist_cache (self ):
449
- if self ._store and (datetime .now () - self ._cache_last_write ).total_seconds () > CACHE_WRITE_PERIOD :
449
+ if self ._is_temp :
450
+ return
451
+
452
+ if self ._store :
453
+ if (datetime .now () - self ._cache_last_write ).total_seconds () > CACHE_WRITE_PERIOD :
450
454
451
- _LOGGER .debug (f"Persist cache" )
452
- self ._cache_last_write = datetime .now ()
455
+ _LOGGER .debug (f"Persist cache" )
456
+ self ._cache_last_write = datetime .now ()
453
457
454
- store = await self ._store .async_get_data () or {}
455
- store ["cache" ] = self ._cache
456
- await self ._store .async_set_data (store )
458
+ store = await self ._store .async_get_data () or {}
459
+ store ["cache" ] = self ._cache
460
+ await self ._store .async_set_data (store )
461
+ else :
462
+ _LOGGER .warning (f"Skip persisting cache; no store available to write to" )
457
463
458
464
459
465
def _getModified (self , entity : StuderEntityData ) -> Any :
Original file line number Diff line number Diff line change 10
10
"issue_tracker" : " https://github.com/ankohanse/hass-studer-xcom/issues" ,
11
11
"loggers" : [" custom_components.studer_xcom" ],
12
12
"requirements" : [" aioxcom>=1.6.1" ],
13
- "version" : " 2024.11.4 "
13
+ "version" : " 2024.12.2 "
14
14
}
You can’t perform that action at this time.
0 commit comments