diff options
Diffstat (limited to 'examples/bluetooth/btscanner/device.py')
-rw-r--r-- | examples/bluetooth/btscanner/device.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/bluetooth/btscanner/device.py b/examples/bluetooth/btscanner/device.py index 02fc53f0b..c75f5b8a1 100644 --- a/examples/bluetooth/btscanner/device.py +++ b/examples/bluetooth/btscanner/device.py @@ -3,7 +3,7 @@ from PySide6.QtCore import QPoint, Qt, Slot from PySide6.QtGui import QColor -from PySide6.QtWidgets import QDialog, QListWidgetItem, QListWidget, QMenu +from PySide6.QtWidgets import QDialog, QListWidgetItem, QMenu from PySide6.QtBluetooth import (QBluetoothAddress, QBluetoothDeviceDiscoveryAgent, QBluetoothDeviceInfo, QBluetoothLocalDevice) @@ -46,7 +46,7 @@ class DeviceDiscoveryDialog(QDialog): item = QListWidgetItem(label) pairing_status = self._local_device.pairingStatus(info.address()) if (pairing_status == QBluetoothLocalDevice.Paired - or pairing_status == QBluetoothLocalDevice.AuthorizedPaired): + or pairing_status == QBluetoothLocalDevice.AuthorizedPaired): item.setForeground(QColor(Qt.green)) else: item.setForeground(QColor(Qt.black)) @@ -123,7 +123,8 @@ class DeviceDiscoveryDialog(QDialog): items = self._ui.list.findItems(address.toString(), Qt.MatchContains) color = QColor(Qt.red) - if pairing == QBluetoothLocalDevice.Paired or pairing == QBluetoothLocalDevice.AuthorizedPaired: + if (pairing == QBluetoothLocalDevice.Paired + or pairing == QBluetoothLocalDevice.AuthorizedPaired): color = QColor(Qt.green) for item in items: item.setForeground(color) |