added generator function + unit test

- added print to test sensor get
- added __init__