homebridge-kasa-python 2.5.14 → 2.5.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/python/kasaApi.py +11 -5
- package/package.json +1 -1
package/dist/python/kasaApi.py
CHANGED
|
@@ -86,7 +86,8 @@ async def discover_devices(username=None, password=None, additional_broadcasts=N
|
|
|
86
86
|
|
|
87
87
|
for ip, dev in discovered_devices.items():
|
|
88
88
|
app.logger.debug(f"Processing device {ip}")
|
|
89
|
-
|
|
89
|
+
device_type = getattr(dev, 'device_type', None)
|
|
90
|
+
if device_type:
|
|
90
91
|
devices[ip] = dev
|
|
91
92
|
app.logger.debug(f"Added device {ip} with device type {dev.device_type} from broadcast {broadcast} to devices list")
|
|
92
93
|
else:
|
|
@@ -102,12 +103,17 @@ async def discover_devices(username=None, password=None, additional_broadcasts=N
|
|
|
102
103
|
app.logger.debug(f"Manual device {host} already exists in devices, skipping.")
|
|
103
104
|
continue
|
|
104
105
|
try:
|
|
105
|
-
|
|
106
|
-
|
|
106
|
+
if creds is not None:
|
|
107
|
+
app.logger.debug(f"Discovering manual device with credentials: {host}")
|
|
108
|
+
discovered_device = await Discover.discover_single(host=host, credentials=creds)
|
|
109
|
+
else:
|
|
110
|
+
app.logger.debug(f"Discovering manual device without credentials: {host}")
|
|
111
|
+
discovered_device = await Discover.discover_single(host=host)
|
|
107
112
|
if discovered_device:
|
|
108
|
-
|
|
113
|
+
device_type = getattr(dev, 'device_type', None)
|
|
114
|
+
if device_type:
|
|
109
115
|
devices[host] = discovered_device
|
|
110
|
-
app.logger.debug(f"Discovered manual device: {host}")
|
|
116
|
+
app.logger.debug(f"Discovered manual device: {host} with device type {dev.device_type}")
|
|
111
117
|
else:
|
|
112
118
|
app.logger.warning(f"Manual device {host} is missing device_type and was not added")
|
|
113
119
|
else:
|
package/package.json
CHANGED