Skip to content

H100 - Raised error: not enough values to unpack (expected 2, got 1) #1499

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

Closed
LXGaming opened this issue Feb 9, 2025 · 5 comments · Fixed by #1500
Closed

H100 - Raised error: not enough values to unpack (expected 2, got 1) #1499

LXGaming opened this issue Feb 9, 2025 · 5 comments · Fixed by #1500
Labels
bug Something isn't working

Comments

@LXGaming
Copy link
Contributor

LXGaming commented Feb 9, 2025

Hello,

I discovered in Home Assistant that my T310 (connected via H100) was reported as unavailable and upon investigating I found that python-kasa was throwing the attached error.

I ran the following command from inside the Home Assistant v2025.2.1 docker container kasa --username <username> --password <password> --host <host> --debug &> dump.txt.

python-kasa-v0.10.1-dump.txt

@rytilahti
Copy link
Member

Looks like the device is not reporting its build version as part of the firmware version field:

'fw_ver': '1.5.0',  

which causes the crash as the code is expecting the version string to contain an empty space.

Relevant information from the log:

  File "/usr/local/lib/python3.13/site-packages/kasa/cli/device.py", line 70, in state
    title_prefix=f"{child.alias} ({child.model})",
                                   ^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/kasa/smart/smartdevice.py", line 590, in model
    return self.device_info.short_name
           ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/kasa/smart/smartchilddevice.py", line 63, in device_info
    return self._get_device_info(
           ~~~~~~~~~~~~~~~~~~~~~^
        {
        ^
    ...<3 lines>...
        None,
        ^^^^^
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/kasa/smart/smartdevice.py", line 916, in _get_device_info
    firmware_version, firmware_build = fw_version_full.split(" ", maxsplit=1)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

It would be great if you could create a fixture file (https://python-kasa.readthedocs.io/en/stable/contribute.html#contributing-fixture-files) to this device and upload it, so we can add a test & create a fix for this. This can be done on any device that runs python, so no need to do it inside a docker container.

@rytilahti rytilahti added the bug Something isn't working label Feb 9, 2025
@LXGaming
Copy link
Contributor Author

LXGaming commented Feb 9, 2025

Unfortunately attempting to create a fixture results in the same error occurring

python-kasa-fixture-dump.txt

@rytilahti
Copy link
Member

You could try with #1500 to see if that helps. If you have github client installed, gh pr checkout 1500 will fetch the correct branch.

@LXGaming
Copy link
Contributor Author

LXGaming commented Feb 9, 2025

Thank you for fixing that, I've attached the fixture.

T310(US)_1.0_1.5.0.json

@rytilahti
Copy link
Member

Thanks for reporting and for the fixture, this should be fixed in the next release!

This was referenced Feb 12, 2025
sdb9696 added a commit that referenced this issue Feb 12, 2025
## [0.10.2](https://github.com/python-kasa/python-kasa/tree/0.10.2) (2025-02-12)

[Full Changelog](0.10.1...0.10.2)

**Release summary:**

- Bugfix for [#1499](#1499).
- Support for L530B and C110 devices.

**Fixed bugs:**

- H100 - Raised error: not enough values to unpack \(expected 2, got 1\) [\#1499](#1499)
- Do not crash on missing build number in fw version [\#1500](#1500) (@rytilahti)

**Added support for devices:**

- Add C110\(EU\) 2.0 1.4.3 fixture [\#1503](#1503) (@sdb9696)
- Add L530B\(EU\) 3.0 1.1.9 fixture [\#1502](#1502) (@sdb9696)

**Project maintenance:**

- Add fixtures for new versions of H100, P110, and T100 devices [\#1501](#1501) (@LXGaming)
- Add L530E\(TW\) 2.0 1.1.1 fixture [\#1497](#1497) (@bluehomewu)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants