MCPcopy Create free account
hub / github.com/DexterInd/GoPiGo3 / DHTSensor

Function DHTSensor

Software/Python/easygopigo3.py:1320–1335  ·  view source on GitHub ↗

Use :py:class:`easysensors.DHTSensor` instead

(gpg=None, sensor_type=0, use_mutex=False)

Source from the content-addressed store, hash-verified

1318 return old_instantiation(gpg.init_distance_sensor, "distance sensor", port, gpg, use_mutex)
1319
1320def DHTSensor(gpg=None, sensor_type=0, use_mutex=False):
1321 """
1322 Use :py:class:`easysensors.DHTSensor` instead
1323 """
1324 if not isinstance(gpg, gopigo3.GoPiGo3):
1325 raise TypeError("Use a GoPiGo3 object for the gpg parameter.")
1326
1327 if gpg.use_mutex != use_mutex:
1328 msg = "Invalid use of mutex: the GoPiGo3 {} mutex protection and the distance sensor {}."
1329 raise ValueError(msg.format(
1330 "uses" if gpg.use_mutex else "does not use",
1331 "does" if use_mutex else "does not"))
1332
1333 warnings.warn(deprecated_msg.format(sensor_description), DeprecationWarning)
1334 print(deprecated_msg.format(sensor_description))
1335 return gpg.init_dht_sensor(sensor_type=sensor_type)

Callers

nothing calls this directly

Calls 2

init_dht_sensorMethod · 0.80
ValueErrorClass · 0.70

Tested by

no test coverage detected