updated device control and switch query
Merge branch 'master' of https://github.com/TDXDigital/TPS