Add modbus get_hub (#54277)
* Add dict with hubs. * Update flexit to use get_hub. * Remove executor_task for close.
This commit is contained in:
parent
7590cb2861
commit
e8aa280d7f
10 changed files with 36 additions and 30 deletions
|
@ -9,8 +9,8 @@ from homeassistant.core import HomeAssistant
|
|||
from homeassistant.helpers.restore_state import RestoreEntity
|
||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||
|
||||
from . import get_hub
|
||||
from .base_platform import BasePlatform
|
||||
from .const import MODBUS_DOMAIN
|
||||
|
||||
PARALLEL_UPDATES = 1
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
@ -29,7 +29,7 @@ async def async_setup_platform(
|
|||
return
|
||||
|
||||
for entry in discovery_info[CONF_BINARY_SENSORS]:
|
||||
hub = hass.data[MODBUS_DOMAIN][discovery_info[CONF_NAME]]
|
||||
hub = get_hub(hass, discovery_info[CONF_NAME])
|
||||
sensors.append(ModbusBinarySensor(hub, entry))
|
||||
|
||||
async_add_entities(sensors)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue