This commit is contained in:
@ -100,19 +100,21 @@ export class ActivityService {
|
||||
let currentOtherState: IActivityState =
|
||||
this._stateDataProvider.states[controlUnitKey]!;
|
||||
|
||||
if (currentOtherState) {
|
||||
currentOtherState.currentActivity.DeviceSetupList.forEach(
|
||||
(value: IDeviceSetupItem) => {
|
||||
//there are devices to remove
|
||||
if (devicesToTurnOn.some((e) => e && e.name === value.DeviceName)) {
|
||||
let deviceToRemove: HarmonyDevice = devicesToTurnOn.filter(
|
||||
(i) => i.name === value.DeviceName
|
||||
)[0];
|
||||
delete devicesToTurnOn[devicesToTurnOn.indexOf(deviceToRemove)];
|
||||
}
|
||||
}
|
||||
);
|
||||
if (!currentOtherState) {
|
||||
return devicesToTurnOn;
|
||||
}
|
||||
|
||||
currentOtherState.currentActivity.DeviceSetupList.forEach(
|
||||
(value: IDeviceSetupItem) => {
|
||||
//there are devices to remove
|
||||
if (devicesToTurnOn.some((e) => e && e.name === value.DeviceName)) {
|
||||
let deviceToRemove: HarmonyDevice = devicesToTurnOn.filter(
|
||||
(i) => i.name === value.DeviceName
|
||||
)[0];
|
||||
delete devicesToTurnOn[devicesToTurnOn.indexOf(deviceToRemove)];
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
return devicesToTurnOn;
|
||||
|
Reference in New Issue
Block a user