parent
d72a181e30
commit
1e276a7b07
|
@ -66,8 +66,8 @@ def setup(hass, config):
|
|||
interface)
|
||||
|
||||
_LOGGER.debug("Expecting %s gateways", len(gateways))
|
||||
for _ in range(discovery_retry):
|
||||
_LOGGER.info('Discovering Xiaomi Gateways (Try %s)', _ + 1)
|
||||
for k in range(discovery_retry):
|
||||
_LOGGER.info('Discovering Xiaomi Gateways (Try %s)', k + 1)
|
||||
hass.data[PY_XIAOMI_GATEWAY].discover_gateways()
|
||||
if len(hass.data[PY_XIAOMI_GATEWAY].gateways) >= len(gateways):
|
||||
break
|
||||
|
@ -152,8 +152,8 @@ class XiaomiDevice(Entity):
|
|||
self._name = '{}_{}'.format(name, self._sid)
|
||||
self._write_to_hub = xiaomi_hub.write_to_hub
|
||||
self._get_from_hub = xiaomi_hub.get_from_hub
|
||||
xiaomi_hub.callbacks[self._sid].append(self.push_data)
|
||||
self._device_state_attributes = {}
|
||||
xiaomi_hub.callbacks[self._sid].append(self.push_data)
|
||||
self.parse_data(device['data'])
|
||||
self.parse_voltage(device['data'])
|
||||
|
||||
|
@ -164,7 +164,7 @@ class XiaomiDevice(Entity):
|
|||
|
||||
@property
|
||||
def should_poll(self):
|
||||
"""Poll update device status."""
|
||||
"""No polling needed."""
|
||||
return False
|
||||
|
||||
@property
|
||||
|
|
Loading…
Reference in New Issue