diff --git a/README.rst b/README.rst index 929827e..3c96315 100644 --- a/README.rst +++ b/README.rst @@ -35,7 +35,7 @@ Install First, install the dependencies:: - sudo apt-get install python-pip python3-pip python-w1thermsensor python3-w1thermsensor python-spidev python3-spidev + sudo apt-get install python-pip python3-pip python-spidev python3-spidev Install with pip:: diff --git a/docs/index.md b/docs/index.md index 71cfd4f..321f6b3 100644 --- a/docs/index.md +++ b/docs/index.md @@ -34,7 +34,7 @@ colour LEDs, robotics kits and more. First, install the dependencies: ```python -sudo apt-get install python-pip python3-pip python-w1thermsensor python3-w1thermsensor python-spidev python3-spidev +sudo apt-get install python-pip python3-pip python-spidev python3-spidev ``` Install with pip: diff --git a/docs/inputs.md b/docs/inputs.md index 9f3386c..1638aeb 100644 --- a/docs/inputs.md +++ b/docs/inputs.md @@ -175,42 +175,6 @@ LightSensor(pin=None, queue_len=5, charge_time_limit=10, | `when_light` | A reference to the function to be called when light is detected. | `None` or Function | | `when_dark` | A reference to the function to be called when darkness is detected. | `None` or Function | -## Temperature Sensor - -One-wire Digital Temperature Sensor. - -### Wiring - -... - -### Code - -Ensure the `TemperatureSensor` class is imported at the top of the file: - -```python -from gpiozero import TemperatureSensor -``` - -Create a `TemperatureSensor` object: - -```python -temp = TemperatureSensor() -``` - -#### Initialisation options - -... - -#### Methods - -... - -#### Properties - -| Property | Description | Type | -| -------- | ----------- | ---- | -| `value` | The current temperature reading in degrees Celsius. | Float | - ## MCP3008 Analogue-to-Digital Converter MCP3008 ADC (Analogue-to-Digital converter). diff --git a/docs/notes.md b/docs/notes.md index a2e1bce..e2a3969 100644 --- a/docs/notes.md +++ b/docs/notes.md @@ -165,19 +165,20 @@ attached to: my_button = Button(2) ``` -Some classes require no arguments due to the nature of the device: +Some classes have multiple arguments, usually with some being optional. When +arguments are optional, common default values are used. The following example: ```python -temp = TemperatureSensor() +my_button = Button(2) ``` -Others have multiple arguments, usually with some being optional: +is equivalent to: ```python -temp = TemperatureSensor() +my_button = Button(2, True) ``` -When arguments are optional, common default values are used. +because the second argument defaults to `True`. Arguments can be given unnamed, as long as they are in order: diff --git a/gpiozero/__init__.py b/gpiozero/__init__.py index b505961..f0a6f97 100644 --- a/gpiozero/__init__.py +++ b/gpiozero/__init__.py @@ -3,7 +3,7 @@ from __future__ import ( print_function, absolute_import, division, - ) +) from .devices import ( GPIODeviceClosed, @@ -16,7 +16,6 @@ from .input_devices import ( Button, MotionSensor, LightSensor, - TemperatureSensor, AnalogInputDevice, MCP3008, MCP3004, diff --git a/gpiozero/input_devices.py b/gpiozero/input_devices.py index c365881..e686c6a 100644 --- a/gpiozero/input_devices.py +++ b/gpiozero/input_devices.py @@ -12,7 +12,6 @@ from time import sleep, time from threading import Event from RPi import GPIO -from w1thermsensor import W1ThermSensor from spidev import SpiDev from .devices import ( @@ -499,15 +498,6 @@ LightSensor.wait_for_light = LightSensor.wait_for_active LightSensor.wait_for_dark = LightSensor.wait_for_inactive -class TemperatureSensor(W1ThermSensor): - """ - A Digital Temperature Sensor. - """ - @property - def value(self): - return self.get_temperature() - - class AnalogInputDevice(CompositeDevice): """ Represents an analog input device connected to SPI (serial interface). @@ -606,4 +596,3 @@ class MCP3004(MCP3008): if not 0 <= channel < 4: raise InputDeviceError('channel must be between 0 and 3') super(MCP3004, self).__init__(device, channel) - diff --git a/gpiozero/output_devices.py b/gpiozero/output_devices.py index 0a85915..920298a 100644 --- a/gpiozero/output_devices.py +++ b/gpiozero/output_devices.py @@ -3,7 +3,7 @@ from __future__ import ( print_function, absolute_import, division, - ) +) import warnings from time import sleep @@ -19,7 +19,7 @@ from .devices import ( GPIOThread, CompositeDevice, SourceMixin, - ) +) class OutputDeviceError(GPIODeviceError): @@ -439,4 +439,3 @@ class Motor(SourceMixin, CompositeDevice): """ self._forward.off() self._backward.off() - diff --git a/setup.py b/setup.py index d526e98..56d6f5d 100644 --- a/setup.py +++ b/setup.py @@ -46,7 +46,6 @@ __keywords__ = [ __requires__ = [ 'RPi.GPIO', - 'w1thermsensor', 'spidev', ]