-
-
Notifications
You must be signed in to change notification settings - Fork 239
Description
When using the library implementation in my plug-in in Homebridge, if I run Discover.discover(), I get a 'type' error on discovery.
I have tried several different variations of the library, v0.7.1-v0.7.7 and all are giving this user the same errors for this particular user and their error.
I have logging information from them for the Discover.discover() run on their system below:
[11/6/2024, 8:33:49 PM] [KasaPython] [2024-11-06 20:33:49,297] ERROR in kasaApi: Error during device discovery: 'type'
[2024-11-06 20:33:49,298] ERROR in kasaApi: Traceback: Traceback (most recent call last):
File "/var/lib/homebridge/node_modules/homebridge-kasa-python/dist/python/kasaApi.py", line 34, in discover_devices
app.logger.debug(f'Discovered devices: {devices}')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/lib/homebridge/kasa-python/.venv/lib/python3.11/site-packages/kasa/device.py", line 474, in repr
return f"<{self.device_type} at {self.host} - {self.alias} ({self.model})>"
^^^^^^^^^^^^^^^^
File "/var/lib/homebridge/kasa-python/.venv/lib/python3.11/site-packages/kasa/smart/smartdevice.py", line 736, in device_type
list(self._components.keys()), self._info["type"]
~~~~~~~~~~^^^^^^^^
KeyError: 'type'
It seems that this error may be related to the devices not being discovered correctly?
The user in question has devices that are new and old and some require credentials and some do not. They do not wish to provide the credentials or have the devices discovered.
Is there a way to filter out devices during discovery if credentials are not provided so that the library does not try to connect to them?