Skip to content

Commit

Permalink
Change name of lock.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasbkarlsson authored Aug 2, 2024
1 parent 52be9ab commit e833b4c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions custom_components/ev_smart_charging/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,14 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:

return unloaded

my_lock = asyncio.Lock()
# Global lock
ev_smart_charging_lock = asyncio.Lock()

async def async_reload_entry(hass: HomeAssistant, entry: ConfigEntry) -> None:
"""Reload config entry."""
_LOGGER.debug("async_reload_entry")
async with my_lock:
# Make sure setup is completed before next unload is started.
async with ev_smart_charging_lock:
await async_unload_entry(hass, entry)
await async_setup_entry(hass, entry)

Expand Down

0 comments on commit e833b4c

Please sign in to comment.