|
1 |
| -# The MIT License (MIT) |
| 1 | +# SPDX-FileCopyrightText: 2017 Tony DiCola for Adafruit Industries |
2 | 2 | #
|
3 |
| -# Copyright (c) 2017 Tony DiCola for Adafruit Industries |
4 |
| -# |
5 |
| -# Permission is hereby granted, free of charge, to any person obtaining a copy |
6 |
| -# of this software and associated documentation files (the "Software"), to deal |
7 |
| -# in the Software without restriction, including without limitation the rights |
8 |
| -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
9 |
| -# copies of the Software, and to permit persons to whom the Software is |
10 |
| -# furnished to do so, subject to the following conditions: |
11 |
| -# |
12 |
| -# The above copyright notice and this permission notice shall be included in |
13 |
| -# all copies or substantial portions of the Software. |
14 |
| -# |
15 |
| -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
16 |
| -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
17 |
| -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
18 |
| -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
19 |
| -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
20 |
| -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
21 |
| -# THE SOFTWARE. |
| 3 | +# SPDX-License-Identifier: MIT |
| 4 | + |
22 | 5 | """
|
23 | 6 | `adafruit_tsl2591`
|
24 | 7 | ====================================================
|
|
96 | 79 |
|
97 | 80 | class TSL2591:
|
98 | 81 | """TSL2591 high precision light sensor.
|
99 |
| - :param busio.I2C i2c: The I2C bus connected to the sensor |
100 |
| - :param int address: The I2C address of the sensor. If not specified |
101 |
| - the sensor default will be used. |
| 82 | + :param busio.I2C i2c: The I2C bus connected to the sensor |
| 83 | + :param int address: The I2C address of the sensor. If not specified |
| 84 | + the sensor default will be used. |
102 | 85 | """
|
103 | 86 |
|
104 | 87 | # Class-level buffer to reduce memory usage and allocations.
|
@@ -232,15 +215,13 @@ def full_spectrum(self):
|
232 | 215 |
|
233 | 216 | @property
|
234 | 217 | def infrared(self):
|
235 |
| - """Read the infrared light and return its value as a 16-bit unsigned number. |
236 |
| - """ |
| 218 | + """Read the infrared light and return its value as a 16-bit unsigned number.""" |
237 | 219 | _, channel_1 = self.raw_luminosity
|
238 | 220 | return channel_1
|
239 | 221 |
|
240 | 222 | @property
|
241 | 223 | def visible(self):
|
242 |
| - """Read the visible light and return its value as a 32-bit unsigned number. |
243 |
| - """ |
| 224 | + """Read the visible light and return its value as a 32-bit unsigned number.""" |
244 | 225 | channel_0, channel_1 = self.raw_luminosity
|
245 | 226 | full = (channel_1 << 16) | channel_0
|
246 | 227 | return full - channel_1
|
|
0 commit comments