@@ -289,6 +289,7 @@ def wrapper():
289
289
coordinator .grocy_api .add_generic (entity_type , data )
290
290
291
291
await hass .async_add_executor_job (wrapper )
292
+ await post_generic_refresh (coordinator , entity_type );
292
293
293
294
294
295
async def async_update_generic_service (hass , coordinator , data ):
@@ -307,6 +308,7 @@ def wrapper():
307
308
coordinator .grocy_api .update_generic (entity_type , object_id , data )
308
309
309
310
await hass .async_add_executor_job (wrapper )
311
+ await post_generic_refresh (coordinator , entity_type );
310
312
311
313
312
314
async def async_delete_generic_service (hass , coordinator , data ):
@@ -323,8 +325,13 @@ def wrapper():
323
325
coordinator .grocy_api .delete_generic (entity_type , object_id )
324
326
325
327
await hass .async_add_executor_job (wrapper )
328
+ await post_generic_refresh (coordinator , entity_type );
326
329
327
330
331
+ async def post_generic_refresh (coordinator , entity_type ):
332
+ if entity_type == "tasks" or entity_type == "chores" :
333
+ await _async_force_update_entity (coordinator , entity_type )
334
+
328
335
async def async_consume_recipe_service (hass , coordinator , data ):
329
336
"""Consume a recipe in Grocy."""
330
337
recipe_id = data [SERVICE_RECIPE_ID ]
0 commit comments