| 123456789101112131415161718192021 |
- """
- Setup for different kinds of Tuya Binary sensors
- """
- from .generic.binary_sensor import TuyaLocalBinarySensor
- from .helpers.config import async_tuya_setup_platform
- async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
- """Set up the sensor device according to it's type."""
- await async_tuya_setup_platform(
- hass,
- async_add_entities,
- discovery_info,
- "binary_sensor",
- TuyaLocalBinarySensor,
- )
- async def async_setup_entry(hass, config_entry, async_add_entities):
- config = {**config_entry.data, **config_entry.options}
- await async_setup_platform(hass, {}, async_add_entities, config)
|