mirror of
https://github.com/cmur2/python-veml6070.git
synced 2026-10-06 16:54:29 +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:
1 parent
df23b9905b
commit
4eda08a9c9
3 files changed
+24
-22
No files matched your search
@@ -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):
|
||||
|
||||
Reference in new issue
Block a user