- #$state->{'slots'}->{$slot}->{'device_status'} = 9;
- if ($label and $state->{'slots'}->{$slot}->{'barcode'}) {
- $state->{'bc2lb'}->{$state->{'slots'}->{$slot}->{'barcode'}} = $label;
+ $state->{'slots'}->{$slot}->{'device_status'} = $device->status;
+ my $barcode = $state->{'slots'}->{$slot}->{'barcode'};
+ if ($label and $barcode) {
+ my $old_label = $state->{'bc2lb'}->{$barcode};
+ if (defined $old_label and $old_label ne $label) {
+ $self->_debug("load drive $drive slot $slot");
+ $self->_debug("update label '$label' for barcode '$barcode', old label was '$old_label'");
+ }
+ $state->{'bc2lb'}->{$barcode} = $label;