Thanks to visit codestin.com
Credit goes to github.com

Skip to content

device __repr__ fails if no sys_info #1262

@jimboca

Description

@jimboca

I've just begun finally migrating from python-kasa 0.5 and received this exception on device needing an update.

Traceback (most recent call last):
  File "/usr/home/admin/dev/pg3/udi-poly-kasa/nodes/SmartDeviceNode.py", line 150, in connect_a
    res = await self.update_a()
          ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/home/admin/dev/pg3/udi-poly-kasa/nodes/SmartDeviceNode.py", line 209, in update_a
    LOGGER.debug(f'enter: {self.name} dev={self.dev}')
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/home/admin/dev/pg3/udi-poly-kasa/kasa/device.py", line 497, in __repr__
    f" {self.alias} ({self.model}){update_needed}>"
                      ^^^^^^^^^^
  File "/usr/home/admin/dev/pg3/udi-poly-kasa/kasa/iot/iotdevice.py", line 54, in wrapped
    if self._last_update is None and f.__name__ not in self._sys_info:
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'NoneType' is not iterable

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions