cleanInactiveDevices method
Implementation
void cleanInactiveDevices(DateTime now) {
deviceList.removeWhere((key, device) {
final inactiveDuration = now.difference(device.activeTime).inSeconds;
return inactiveDuration > 120; // 超过120秒未活跃
});
}