1
0
mirror of https://github.com/cmur2/python-veml6070.git synced 2025-06-26 12:30:19 +02:00

module: calculate UVA light intensity correctly for rset != RSET_240K

- compensation for rset != RSET_240K was wrong, it increased UVA power/ADC step for rset > RSET_240K
- UVA power/ADC step should have been decreasing as refresh time (sampling time) got longer
- same behavior as with integration_time setting, that works correctly
This commit is contained in:
cn
2019-09-19 01:18:42 +02:00
parent df23b9905b
commit 4eda08a9c9
3 changed files with 24 additions and 22 deletions

View File

@ -85,9 +85,9 @@ class TestVeml6070(snapshottest.TestCase):
0x38+0: [0x06, 0x06]
})
veml = veml6070.Veml6070()
self.assertEqual(veml.get_uva_light_intensity(), 0x0106 * 0.05625 / 1)
self.assertEqual(veml.get_uva_light_intensity(), 0x0106 * (0.1/0.1125) * 0.05 / 1)
veml.set_integration_time(veml6070.INTEGRATIONTIME_4T)
self.assertEqual(veml.get_uva_light_intensity(), 0x0106 * 0.05625 / 4)
self.assertEqual(veml.get_uva_light_intensity(), 0x0106 * (0.1/0.1125) * 0.05 / 4)
self.assertMatchSnapshot(mockbus._log)
def test_get_refresh_time(self):