* refactoring and added tests to sensor * using caplog and not mocking main setup method in sensor tests