Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OTA command failing with HueSBLOTAImage #22

Closed
TheJulianJES opened this issue Dec 27, 2022 · 1 comment · Fixed by #23
Closed

OTA command failing with HueSBLOTAImage #22

TheJulianJES opened this issue Dec 27, 2022 · 1 comment · Fixed by #23

Comments

@TheJulianJES
Copy link

Running the following command produces an error, as zigpy's HueSBLOTAImage does not have (valid) subelements:
zigpy-cli ota info LivingColors-Atmel-Target_0012.sbl-ota

Download link for the OTA image: https://otau.meethue.com/storage/ZGB_100B_0108/55fb9cf3-afb6-4ef5-8887-905699da7ee8/LivingColors-Atmel-Target_0012.sbl-ota

The error is caused here when printing the number of subelements:

print(f"Number of subelements: {len(image.subelements)}")

Command output:

Header: OTAImageHeader(upgrade_file_id=200208670, header_version=256, header_length=56, field_control=<FieldControl.0: 0>, manufacturer_id=4107, image_type=264, file_version=1124099330, stack_version=2, header_string='', image_size=256696, *device_specific_file=False, *hardware_versions_present=False, *key=ImageKey(manufacturer_id=4107, image_type=264), *security_credential_version_present=False)
Traceback (most recent call last):
  File "/Users/test/GP/zigpy-cli/venv/bin/zigpy", line 33, in <module>
    sys.exit(load_entry_point('zigpy-cli==0.0.1', 'console_scripts', 'zigpy')())
  File "/Users/test/GP/zigpy-cli/venv/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/Users/test/GP/zigpy-cli/venv/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/Users/test/GP/zigpy-cli/venv/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/test/GP/zigpy-cli/venv/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/test/GP/zigpy-cli/venv/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/test/GP/zigpy-cli/venv/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/Users/test/GP/zigpy-cli/venv/lib/python3.10/site-packages/zigpy_cli/ota.py", line 37, in info
    print(f"Number of subelements: {len(image.subelements)}")
AttributeError: 'HueSBLOTAImage' object has no attribute 'subelements'
@puddly
Copy link
Contributor

puddly commented Dec 27, 2022

I think this may also be a bug with zigpy itself. The image validation code expects subelements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants