@@ -48,9 +48,6 @@ export class DeviceListItemComponent implements OnInit {
48
48
this . _lighthouseDevice = undefined ;
49
49
this . _ovrDevice = device ;
50
50
this . deviceName = device . modelNumber ;
51
- this . deviceIdentifier = device . serialNumber ;
52
- this . deviceRole = device . handleType ;
53
- this . deviceNickname = this . openvr . getDeviceNickname ( device ) ;
54
51
this . showBattery = Boolean ( device . providesBatteryStatus || device . isCharging ) ;
55
52
this . isCharging = this . showBattery && device . isCharging ;
56
53
this . batteryPercentage = this . showBattery ? device . battery * 100 : 0 ;
@@ -65,6 +62,13 @@ export class DeviceListItemComponent implements OnInit {
65
62
this . cssId = this . sanitizeIdentifierForCSS ( device . serialNumber ) ;
66
63
this . powerButtonAnchorId = '--anchor-device-pwr-btn-' + this . cssId ;
67
64
this . showLHStatePopover = false ;
65
+
66
+ const nickname = this . openvr . getDeviceNickname ( device ) ;
67
+ this . deviceHasNickname = Boolean ( nickname ) ;
68
+ if ( nickname ) this . deviceSubtitle = nickname ;
69
+ else if ( device . handleType && [ 'Controller' , 'GenericTracker' ] . includes ( device . class ) )
70
+ this . deviceSubtitle = 'comp.device-list.deviceRole.' + device . handleType ;
71
+ else this . deviceSubtitle = device . serialNumber ;
68
72
}
69
73
70
74
@Input ( ) set lighthouseDevice ( device : LighthouseDevice | undefined ) {
@@ -73,9 +77,9 @@ export class DeviceListItemComponent implements OnInit {
73
77
this . _lighthouseDevice = device ;
74
78
this . _ovrDevice = undefined ;
75
79
this . deviceName = 'comp.device-list.deviceName.' + device . deviceType ;
76
- this . deviceIdentifier = device . deviceName ;
77
- this . deviceRole = undefined ;
78
- this . deviceNickname = this . lighthouse . getDeviceNickname ( device ) ;
80
+ const nickname = this . lighthouse . getDeviceNickname ( device ) ;
81
+ this . deviceSubtitle = nickname ?? device . deviceName ;
82
+ this . deviceHasNickname = Boolean ( nickname ) ;
79
83
this . showBattery = false ;
80
84
this . isCharging = false ;
81
85
this . batteryPercentage = 100 ;
@@ -127,9 +131,8 @@ export class DeviceListItemComponent implements OnInit {
127
131
128
132
mode ?: 'lighthouse' | 'openvr' ;
129
133
deviceName = '' ;
130
- deviceIdentifier = '' ;
131
- deviceRole : string | undefined = undefined ;
132
- deviceNickname : string | null = null ;
134
+ deviceSubtitle : string | null = null ;
135
+ deviceHasNickname = false ;
133
136
showBattery = false ;
134
137
isCharging = false ;
135
138
batteryPercentage = 100 ;
0 commit comments