Skip to content

Commit 384b314

Browse files
committed
chore: update diagnostics counters
1 parent dde57b9 commit 384b314

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

roborock/devices/device_manager.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ async def discover_devices(self, prefer_cache: bool = True) -> list[RoborockDevi
109109
new_device = self._device_creator(home_data, device, product)
110110
except UnsupportedDeviceError:
111111
_LOGGER.info("Skipping unsupported device %s %s", product.summary_info(), device.summary_info())
112-
unsupported_devices_counter.increment(device.pv)
112+
unsupported_devices_counter.increment(device.pv or "unknown")
113113
continue
114-
supported_devices_counter.increment(device.pv)
114+
supported_devices_counter.increment(device.pv or "unknown")
115115
start_tasks.append(new_device.start_connect())
116116
new_devices[duid] = new_device
117117

@@ -241,15 +241,17 @@ def device_creator(home_data: HomeData, device: HomeDataDevice, product: HomeDat
241241
model_part = product.model.split(".")[-1]
242242
if "ss" in model_part:
243243
raise UnsupportedDeviceError(
244-
f"Device {device.name} has unsupported version B01_{model_part}"
244+
f"Device {device.name} has unsupported version B01 product model {product.model}"
245245
)
246246
elif "sc" in model_part:
247247
# Q7 devices start with 'sc' in their model naming.
248248
trait = b01.q7.create(channel)
249249
else:
250250
raise UnsupportedDeviceError(f"Device {device.name} has unsupported B01 model: {product.model}")
251251
case _:
252-
raise UnsupportedDeviceError(f"Device {device.name} has unsupported version {device.pv}")
252+
raise UnsupportedDeviceError(
253+
f"Device {device.name} has unsupported version {device.pv} {product.model}"
254+
)
253255

254256
dev = RoborockDevice(device, product, channel, trait)
255257
if ready_callback:

0 commit comments

Comments
 (0)