Skip to content

Commit

Permalink
Merge branch 'master' into add_remove_entities
Browse files Browse the repository at this point in the history
  • Loading branch information
postlund authored Dec 17, 2020
2 parents 3207ee8 + acd70b6 commit 97009c4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions custom_components/localtuya/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ async def async_setup_entry(
# Add DPS used by this platform to the request list
for dp_conf in dps_config_fields:
if dp_conf in device_config:
tuyainterface.add_dps_to_request(device_config[dp_conf])
tuyainterface.dps_to_request[device_config[dp_conf]] = None

entities.append(
entity_class(
Expand Down Expand Up @@ -113,14 +113,14 @@ def __init__(self, hass, config_entry):
self._config_entry = config_entry
self._interface = None
self._status = {}
self._dps_to_request = {}
self.dps_to_request = {}
self._is_closing = False
self._connect_task = None
self.set_logger(_LOGGER, config_entry[CONF_DEVICE_ID])

# This has to be done in case the device type is type_0d
for entity in config_entry[CONF_ENTITIES]:
self._dps_to_request[entity[CONF_ID]] = None
self.dps_to_request[entity[CONF_ID]] = None

@property
def connected(self):
Expand All @@ -143,7 +143,7 @@ async def _make_connection(self):
float(self._config_entry[CONF_PROTOCOL_VERSION]),
self,
)
self._interface.add_dps_to_request(self._dps_to_request)
self._interface.add_dps_to_request(self.dps_to_request)

self.debug("Retrieving initial state")
status = await self._interface.status()
Expand Down

0 comments on commit 97009c4

Please sign in to comment.