Change DeviceEnvironment from custom model to CI.
Fix flake8 errors
Merge pull request #1037 from quamilek/environment_as_ci

Change DeviceEnvironment from custom model to CI.