Skip to content

Commit

Permalink
Fix support default_class
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed May 1, 2022
1 parent e56566d commit 812b4f5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion custom_components/sonoff/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from homeassistant.helpers.storage import Store

from . import system_health
from .core import backward
from .core import backward, devices
from .core.const import *
from .core.ewelink import XRegistry, XRegistryCloud, XRegistryLocal
from .core.ewelink.camera import XCameras
Expand Down Expand Up @@ -62,6 +62,10 @@ async def async_setup(hass: HomeAssistant, config: dict) -> bool:

# load optional global registry config
XRegistry.config = config.get(DOMAIN)
try:
devices.set_default_class(XRegistry.config[CONF_DEFAULT_CLASS])
except Exception:
pass

# cameras starts only on first command to it
cameras = XCameras()
Expand Down

0 comments on commit 812b4f5

Please sign in to comment.