added check if packs available
This commit is contained in:
1 parent
7904a07e7f
commit
33fe91c2d2
2 files changed
+3
-1
No files matched your search
@@ -182,7 +182,7 @@ class PollingCoordinator(DataUpdateCoordinator):
|
|||||||
|
|
||||||
async with self.polling_lock:
|
async with self.polling_lock:
|
||||||
try:
|
try:
|
||||||
async with async_timeout.timeout(30):
|
async with async_timeout.timeout(45):
|
||||||
|
|
||||||
# Reconnect if not connected
|
# Reconnect if not connected
|
||||||
max_retries = 5
|
max_retries = 5
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ async def async_setup_entry(
|
|||||||
all_fields = NORMAL_DEVICE_FIELDS
|
all_fields = NORMAL_DEVICE_FIELDS
|
||||||
all_fields.update(DC_INPUT_FIELDS)
|
all_fields.update(DC_INPUT_FIELDS)
|
||||||
all_fields.update(ADDITIONAL_DEVICE_FIELDS)
|
all_fields.update(ADDITIONAL_DEVICE_FIELDS)
|
||||||
|
|
||||||
|
if len(bluetti_device.pack_polling_commands) > 0:
|
||||||
# add pack fields for device
|
# add pack fields for device
|
||||||
_LOGGER.info("Device type(%s) pack_num_max(%s)", bluetti_device.type, bluetti_device.pack_num_max)
|
_LOGGER.info("Device type(%s) pack_num_max(%s)", bluetti_device.type, bluetti_device.pack_num_max)
|
||||||
for pack in range (1, bluetti_device.pack_num_max + 1):
|
for pack in range (1, bluetti_device.pack_num_max + 1):
|
||||||
|
|||||||
Reference in new issue
Block a user