Skip to content

Commit 8d393f3

Browse files
committed
Ran pre-commit, added licenses
1 parent 438edff commit 8d393f3

19 files changed

+442
-47
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: Unlicense
4+
15
*.mpy
26
.idea
37
__pycache__

.pylintrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: Unlicense
4+
15
[MASTER]
26

37
# A comma-separated list of package or module names from where C extensions may

.readthedocs.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: Unlicense
4+
15
python:
26
version: 3
37
requirements_file: requirements.txt
4-

CODE_OF_CONDUCT.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
<!--
2+
SPDX-FileCopyrightText: 2014 Coraline Ada Ehmke
3+
SPDX-FileCopyrightText: 2019 Kattni Rembor for Adafruit Industries
4+
SPDX-License-Identifier: CC-BY-4.0
5+
-->
6+
17
# Adafruit Community Code of Conduct
28

39
## Our Pledge
@@ -43,7 +49,7 @@ Examples of unacceptable behavior by participants include:
4349

4450
The goal of the standards and moderation guidelines outlined here is to build
4551
and maintain a respectful community. We ask that you don’t just aim to be
46-
"technically unimpeachable", but rather try to be your best self.
52+
"technically unimpeachable", but rather try to be your best self.
4753

4854
We value many things beyond technical expertise, including collaboration and
4955
supporting others within our community. Providing a positive experience for
@@ -74,9 +80,9 @@ You may report in the following ways:
7480
In any situation, you may send an email to <[email protected]>.
7581

7682
On the Adafruit Discord, you may send an open message from any channel
77-
to all Community Moderators by tagging @community moderators. You may
78-
also send an open message from any channel, or a direct message to
79-
@kattni#1507, @tannewt#4653, @Dan Halbert#1614, @cater#2442,
83+
to all Community Moderators by tagging @community moderators. You may
84+
also send an open message from any channel, or a direct message to
85+
@kattni#1507, @tannewt#4653, @Dan Halbert#1614, @cater#2442,
8086
@sommersoft#0222, @Mr. Certainly#0472 or @Andon#8175.
8187

8288
Email and direct message reports will be kept confidential.

LICENSES/CC-BY-4.0.txt

Lines changed: 324 additions & 0 deletions
Large diffs are not rendered by default.

LICENSES/MIT.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
MIT License Copyright (c) <year> <copyright holders>
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is furnished
8+
to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice (including the next
11+
paragraph) shall be included in all copies or substantial portions of the
12+
Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
17+
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
19+
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

LICENSES/Unlicense.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
This is free and unencumbered software released into the public domain.
2+
3+
Anyone is free to copy, modify, publish, use, compile, sell, or distribute
4+
this software, either in source code form or as a compiled binary, for any
5+
purpose, commercial or non-commercial, and by any means.
6+
7+
In jurisdictions that recognize copyright laws, the author or authors of this
8+
software dedicate any and all copyright interest in the software to the public
9+
domain. We make this dedication for the benefit of the public at large and
10+
to the detriment of our heirs and successors. We intend this dedication to
11+
be an overt act of relinquishment in perpetuity of all present and future
12+
rights to this software under copyright law.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
17+
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
19+
THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information,
20+
please refer to <https://unlicense.org/>

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ Usage Example
5858
Hardware Set-up
5959
----------------
6060

61-
The DHT11 and DHT22 devices both need a pull-resistor on the data signal wire.
62-
This resistor is in the range of 1k to 5k. Please check your device datasheet for the
61+
The DHT11 and DHT22 devices both need a pull-resistor on the data signal wire.
62+
This resistor is in the range of 1k to 5k. Please check your device datasheet for the
6363
appropriate value.
6464

6565
Basics
@@ -99,7 +99,7 @@ Now get the temperature and humidity values
9999
temperature = dht_device.temperature
100100
humidity = dht_device.humidity
101101
102-
These properties may raise an exception if a problem occurs. You should use try/raise
102+
These properties may raise an exception if a problem occurs. You should use try/raise
103103
logic and catch RuntimeError and then retry getting the values after at least 2 seconds.
104104
If you try again to get a result within 2 seconds, cached values are returned.
105105

README.rst.license

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2+
3+
SPDX-License-Identifier: MIT

adafruit_dht.py

Lines changed: 21 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,7 @@
1-
# The MIT License (MIT)
1+
# SPDX-FileCopyrightText: 2017 Mike McWethy for Adafruit Industries
22
#
3-
# Copyright (c) 2017 Mike McWethy 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+
225
"""
236
:mod:`adafruit_dhtlib`
247
======================
@@ -47,8 +30,7 @@
4730

4831

4932
class DHTBase:
50-
""" base support for DHT11 and DHT22 devices
51-
"""
33+
"""base support for DHT11 and DHT22 devices"""
5234

5335
__hiLevel = 51
5436

@@ -110,7 +92,7 @@ def _pulses_to_binary(self, pulses, start, stop):
11092
return binary
11193

11294
def _get_pulses_pulseio(self):
113-
""" _get_pulses implements the communication protcol for
95+
"""_get_pulses implements the communication protcol for
11496
DHT11 and DHT22 type devices. It sends a start signal
11597
of a specific length and listens and measures the
11698
return signal lengths.
@@ -138,7 +120,7 @@ def _get_pulses_pulseio(self):
138120
return pulses
139121

140122
def _get_pulses_bitbang(self):
141-
""" _get_pulses implements the communication protcol for
123+
"""_get_pulses implements the communication protcol for
142124
DHT11 and DHT22 type devices. It sends a start signal
143125
of a specific length and listens and measures the
144126
return signal lengths.
@@ -182,12 +164,12 @@ def _get_pulses_bitbang(self):
182164
return pulses
183165

184166
def measure(self):
185-
""" measure runs the communications to the DHT11/22 type device.
186-
if successful, the class properties temperature and humidity will
187-
return the reading returned from the device.
167+
"""measure runs the communications to the DHT11/22 type device.
168+
if successful, the class properties temperature and humidity will
169+
return the reading returned from the device.
188170
189-
Raises RuntimeError exception for checksum failure and for insuffcient
190-
data returned from the device (try again)
171+
Raises RuntimeError exception for checksum failure and for insuffcient
172+
data returned from the device (try again)
191173
"""
192174
delay_between_readings = 2 # 2 seconds per read according to datasheet
193175
# Initiate new reading if this is the first call or if sufficient delay
@@ -253,39 +235,39 @@ def measure(self):
253235

254236
@property
255237
def temperature(self):
256-
""" temperature current reading. It makes sure a reading is available
238+
"""temperature current reading. It makes sure a reading is available
257239
258-
Raises RuntimeError exception for checksum failure and for insuffcient
259-
data returned from the device (try again)
240+
Raises RuntimeError exception for checksum failure and for insuffcient
241+
data returned from the device (try again)
260242
"""
261243
self.measure()
262244
return self._temperature
263245

264246
@property
265247
def humidity(self):
266-
""" humidity current reading. It makes sure a reading is available
248+
"""humidity current reading. It makes sure a reading is available
267249
268-
Raises RuntimeError exception for checksum failure and for insuffcient
269-
data returned from the device (try again)
250+
Raises RuntimeError exception for checksum failure and for insuffcient
251+
data returned from the device (try again)
270252
"""
271253
self.measure()
272254
return self._humidity
273255

274256

275257
class DHT11(DHTBase):
276-
""" Support for DHT11 device.
258+
"""Support for DHT11 device.
277259
278-
:param ~board.Pin pin: digital pin used for communication
260+
:param ~board.Pin pin: digital pin used for communication
279261
"""
280262

281263
def __init__(self, pin, use_pulseio=_USE_PULSEIO):
282264
super().__init__(True, pin, 18000, use_pulseio)
283265

284266

285267
class DHT22(DHTBase):
286-
""" Support for DHT22 device.
268+
"""Support for DHT22 device.
287269
288-
:param ~board.Pin pin: digital pin used for communication
270+
:param ~board.Pin pin: digital pin used for communication
289271
"""
290272

291273
def __init__(self, pin, use_pulseio=_USE_PULSEIO):

docs/_static/favicon.ico.license

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SPDX-FileCopyrightText: 2018 Phillip Torrone for Adafruit Industries
2+
3+
SPDX-License-Identifier: CC-BY-4.0

docs/api.rst.license

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# SPDX-FileCopyrightText: 2020 ladyada for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT

docs/conf.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# -*- coding: utf-8 -*-
22

3+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
4+
#
5+
# SPDX-License-Identifier: MIT
6+
37
import os
48
import sys
59

docs/examples.rst.license

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# SPDX-FileCopyrightText: 2020 ladyada for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT

docs/index.rst.license

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# SPDX-FileCopyrightText: 2020 ladyada for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT

examples/dht_simpletest.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
# SPDX-License-Identifier: MIT
3+
14
import time
25
import board
36
import adafruit_dht

examples/dht_to_led_display.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
# SPDX-License-Identifier: MIT
3+
14
"""
25
example of reading temperature and humidity from a DHT device
36
and displaying results to the serial port and a 8 digit 7-segment display

requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: Unlicense
4+
15
Adafruit-Blinka

setup.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
15
"""A setuptools based setup module.
26
37
See:

0 commit comments

Comments
 (0)