Skip to content
This repository was archived by the owner on Aug 5, 2024. It is now read-only.

Commit 479e90a

Browse files
simplify function
1 parent f0fc461 commit 479e90a

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

custom_components/gigasetelements/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,7 @@
8585
def setup(hass, config):
8686
def toggle_api_updates(event):
8787
global API_CALLS_ALLOWED
88-
if hass.state == CoreState.running:
89-
API_CALLS_ALLOWED = True
90-
else:
91-
API_CALLS_ALLOWED = False
88+
API_CALLS_ALLOWED = hass.state == CoreState.running
9289
_LOGGER.debug("API calls enabled: " + str(API_CALLS_ALLOWED))
9390

9491
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STARTED, toggle_api_updates)

0 commit comments

Comments
 (0)