fixed circular import

This commit is contained in:
Patrick762 committed 2024-02-05 19:10:11 +01:00
1 parent 9ef9d38a6e
commit ebbcea3c4c
7 files changed
+23 -23

No files matched your search

-14
View File
@@ -12,8 +12,6 @@ from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.exceptions import ConfigEntryNotReady
from bluetti_mqtt.bluetooth import build_device as orig_build_device
from .const import (
CONF_MAX_RETRIES,
CONF_PERSISTENT_CONN,
@@ -22,13 +20,10 @@ from .const import (
CONF_USE_CONTROLS,
DATA_COORDINATOR,
DATA_POLLING_RUNNING,
DEVICE_NAME_RE,
DOMAIN,
MANUFACTURER,
)
from .coordinator import PollingCoordinator
from .devices.ep600 import EP600
from .devices.ep760 import EP760
PLATFORMS: [Platform] = [Platform.BINARY_SENSOR, Platform.SENSOR]
_LOGGER = logging.getLogger(__name__)
@@ -110,12 +105,3 @@ def get_type_by_bt_name(bt_name: str):
elif bt_name.startswith("EP760"):
dev_type = "EP760"
return dev_type
def build_device(address: str, name: str):
match = DEVICE_NAME_RE.match(name)
if match[1] == 'EP760':
return EP760(address, match[2])
elif match[1] == 'EP600':
return EP600(address, match[2])
else:
return orig_build_device(address, name)