Open jojeju9428 opened 3 weeks ago
Resolved by modifying the code as follows.
def handle_devicelist(devicelist):
print("Looking for supported devices:")
global otadict, num_total
for device in devicelist:
# Vérifier si la clé "definition" est présente dans l'objet device
if "definition" in device and device["definition"]:
dev = OtaDevice(
device["friendly_name"],
device["ieee_address"],
device["definition"]["supports_ota"],
False,
False,
False,
)
otadict[dev.ieee_addr] = dev
if dev.supports_ota:
print(
f" {dev.friendly_name} supports OTA Updates, checking for new updates"
)
num_total += 1
check_for_update(dev)
else:
print(f"Device {device.get('friendly_name', 'unknown')} does not support OTA updates or lacks definition data.")
Hello,
I am experiencing an issue running the script since version 1.40.2 of Zigbee2MQTT. Here are the errors encountered when launching the script:
Thanks for help