File tree Expand file tree Collapse file tree 1 file changed +1
-6
lines changed
custom_components/opensurplusmanager Expand file tree Collapse file tree 1 file changed +1
-6
lines changed Original file line number Diff line number Diff line change 4
4
5
5
import asyncio
6
6
7
- from pyosmanager import OSMClient
8
-
9
7
from homeassistant .const import Platform
10
8
from homeassistant .core import HomeAssistant
9
+ from pyosmanager import OSMClient
11
10
12
- from .const import DOMAIN , SEMAPHORE
13
11
from .coordinator import OSMConfigEntry , OSMCoordinator
14
12
from .core import OSMCore
15
13
from .device import OSMDevice
19
17
20
18
async def async_setup_entry (hass : HomeAssistant , entry : OSMConfigEntry ) -> bool :
21
19
"""Set up Open Surplus Manager from a config entry."""
22
- if SEMAPHORE not in hass .data .setdefault (DOMAIN , {}):
23
- hass .data .setdefault (DOMAIN , {})[SEMAPHORE ] = asyncio .Semaphore (1 )
24
- client = OSMClient (entry .data ["host" ])
25
20
26
21
result = await client .is_healthy ()
27
22
if not result :
You can’t perform that action at this time.
0 commit comments