fix compatibility with 4.2
Merge pull request #176 from jmecosta/enhancement/unit-test-sensor-4.2

fix compatibility with 4.2