File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1338,13 +1338,17 @@ impl SpircTask {
13381338 }
13391339
13401340 // Check for active device changes
1341- let new_active_device_id = cluster. active_device_id . clone ( ) ;
1342- if Some ( new_active_device_id. clone ( ) ) != self . last_active_device_id {
1341+ let new_active_device_id = if cluster. active_device_id . is_empty ( ) {
1342+ None
1343+ } else {
1344+ Some ( cluster. active_device_id . clone ( ) )
1345+ } ;
1346+ if new_active_device_id != self . last_active_device_id {
13431347 self . emit_cluster_update ( ClusterUpdateEvent {
13441348 reason : crate :: spirc:: ClusterUpdateReason :: ActiveDeviceChanged ,
1345- device_id : new_active_device_id. clone ( ) ,
1349+ device_id : new_active_device_id. clone ( ) . unwrap_or_default ( ) ,
13461350 } ) ;
1347- self . last_active_device_id = Some ( new_active_device_id) ;
1351+ self . last_active_device_id = new_active_device_id;
13481352 }
13491353
13501354 // Sync device state to cluster_state_sender (after emitting events)
You can’t perform that action at this time.
0 commit comments