Skip to content

Commit 81a23b6

Browse files
committed
readd went off device depended select devices on discovery
1 parent 87e9738 commit 81a23b6

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

klyqa_ctl/klyqa_ctl.py

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1659,11 +1659,28 @@ async def async_answer_callback_local(msg, uid) -> None:
16591659
devices_working: dict[str, KlyqaDevice] = {
16601660
u_id: device
16611661
for u_id, device in self.devices.items()
1662-
if (device.status and device.status.ts > send_started_local)
1663-
or (
1664-
(args.cloud or args.tryLocalThanCloud)
1665-
and device.cloud
1666-
and device.cloud.connected
1662+
if (
1663+
(
1664+
args.type == DeviceType.lighting.name
1665+
and isinstance(device, KlyqaBulb)
1666+
)
1667+
or (
1668+
args.type == DeviceType.cleaner.name
1669+
and isinstance(device, KlyqaVC)
1670+
)
1671+
)
1672+
and (
1673+
(
1674+
device.status
1675+
and device.status.ts
1676+
and isinstance(device.status.ts, datetime.datetime)
1677+
and device.status.ts > send_started_local
1678+
)
1679+
or (
1680+
(args.cloud or args.tryLocalThanCloud)
1681+
and device.cloud
1682+
and device.cloud.connected
1683+
)
16671684
)
16681685
}
16691686
print(

0 commit comments

Comments
 (0)