set_dpsUsed turned into add_dps_to_request ; used it when setting up entities

This commit is contained in:
rospogrigio
2020-09-18 17:19:10 +02:00
committed by rospogrigio
parent 5507652bae
commit 6700e02c52
5 changed files with 34 additions and 16 deletions

View File

@@ -86,12 +86,11 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
if not entities_to_setup:
return
# TODO: keeping for now but should be removed
dps = {}
covers = []
for device_config in entities_to_setup:
dps[device_config[CONF_ID]] = None
# this has to be done in case the device type is type_0d
device.add_dps_to_request(device_config[CONF_ID])
covers.append(
LocaltuyaCover(
TuyaCache(device, config_entry.data[CONF_FRIENDLY_NAME]),
@@ -100,7 +99,6 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
)
)
device.set_dpsUsed(dps)
async_add_entities(covers, True)
def setup_platform(hass, config, add_devices, discovery_info=None):