I think the problem is here:
nextState = this.config.devices.map(device => {
As this loops on this.config.devices, it basically excludes all those devices that are not in that array.
I did not have time to go deeper, I will check better asap and maybe propose some possible solution.