Move ee_brightbox imports at top-level (#29054)
* Move ee_brightbox imports at top-level * Fix tests * Fix : Commented out code
This commit is contained in:
1 parent
78d5184186
commit
44e708f72b
2 files changed
+5
-9
No files matched your search
@@ -1,6 +1,7 @@
|
||||
"""Support for EE Brightbox router."""
|
||||
import logging
|
||||
|
||||
from eebrightbox import EEBrightBox, EEBrightBoxException
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.device_tracker import (
|
||||
@@ -46,8 +47,6 @@ class EEBrightBoxScanner(DeviceScanner):
|
||||
|
||||
def check_config(self):
|
||||
"""Check if provided configuration and credentials are correct."""
|
||||
from eebrightbox import EEBrightBox, EEBrightBoxException
|
||||
|
||||
try:
|
||||
with EEBrightBox(self.config) as ee_brightbox:
|
||||
return bool(ee_brightbox.get_devices())
|
||||
@@ -57,8 +56,6 @@ class EEBrightBoxScanner(DeviceScanner):
|
||||
|
||||
def scan_devices(self):
|
||||
"""Scan for devices."""
|
||||
from eebrightbox import EEBrightBox
|
||||
|
||||
with EEBrightBox(self.config) as ee_brightbox:
|
||||
self.devices = {d["mac"]: d for d in ee_brightbox.get_devices()}
|
||||
|
||||
|
||||
Reference in new issue
Block a user