platypush/plugins/gpio/sensor/dht/__init__.py
def read(self, sensor_type: Optional[str] = None, pin: Optional[int] = None,
             retries: Optional[int] = None, retry_seconds: Optional[int] = None, **__) -> Dict[str, float]:
        """
        Read data from the sensor.

        :param sensor_type: Default ``sensor_type`` override.
        :param pin: Default ``pin`` override.
        :param retries: Default ``retries`` override.
        :param retry_seconds: Default ``retry_seconds`` override.
        :return: A mapping with the measured temperature and humidity. Example:

            .. code-block:: json

                {
                    "humidity": 30.0,
                    "temperature": 25.5
                }

        """
        import Adafruit_DHT
        sensor_type = self._get_sensor_type(sensor_type) if sensor_type else self.sensor_type
        pin = pin or self.pin
        retries = retries or self.retries
        retry_seconds = retry_seconds or self.retry_seconds
        humidity, temperature = Adafruit_DHT.read_retry(sensor=sensor_type,
            pin=pin, retries=retries, delay_seconds=retry_seconds)

        return {
            'humidity': humidity,
            'temperature': temperature,
        }

        Read data from the sensor.

        :param sensor_type: Default ``sensor_type`` override.
        :param pin: Default ``pin`` override.
        :param retries: Default ``retries`` override.
        :param retry_seconds: Default ``retry_seconds`` override.
        :return: A mapping with the measured temperature and humidity. Example:

            .. code-block:: json

                {
                    "humidity": 30.0,
                    "temperature": 25.5
                }

        
Read data from the sensor.
Read data from the sensor .
def read(self, sensor_type: Optional[str] = None, pin: Optional[int] = None,
             retries: Optional[int] = None, retry_seconds: Optional[int] = None, **__) -> Dict[str, float]:
        import Adafruit_DHT
        sensor_type = self._get_sensor_type(sensor_type) if sensor_type else self.sensor_type
        pin = pin or self.pin
        retries = retries or self.retries
        retry_seconds = retry_seconds or self.retry_seconds
        humidity, temperature = Adafruit_DHT.read_retry(sensor=sensor_type,
            pin=pin, retries=retries, delay_seconds=retry_seconds)
        return {
            'humidity': humidity,
            'temperature': temperature,
        }
def read ( self , sensor_type : Optional [ str ] = None , pin : Optional [ int ] = None , retries : Optional [ int ] = None , retry_seconds : Optional [ int ] = None , ** __ ) -> Dict [ str , float ] : import Adafruit_DHT sensor_type = self . _get_sensor_type ( sensor_type ) if sensor_type else self . sensor_type pin = pin or self . pin retries = retries or self . retries retry_seconds = retry_seconds or self . retry_seconds humidity , temperature = Adafruit_DHT . read_retry ( sensor = sensor_type , pin = pin , retries = retries , delay_seconds = retry_seconds ) return { 'humidity' : humidity , 'temperature' : temperature , }
Read data from the sensor.
Read data from the sensor .
"""
        Read data from the sensor.

        :param sensor_type: Default ``sensor_type`` override.
        :param pin: Default ``pin`` override.
        :param retries: Default ``retries`` override.
        :param retry_seconds: Default ``retry_seconds`` override.
        :return: A mapping with the measured temperature and humidity. Example:

            .. code-block:: json

                {
                    "humidity": 30.0,
                    "temperature": 25.5
                }

        """
A mapping with the measured temperature and humidity. Example:
code-block:: json


A mapping with the measured temperature and humidity . Example : code - block :: json
self
sensor_type
Optional[str]
Default ``sensor_type`` override.
Default ` ` sensor_type ` ` override .
pin
Optional[int]
Default ``pin`` override.
Default ` ` pin ` ` override .
retries
Optional[int]
Default ``retries`` override.
Default ` ` retries ` ` override .
retry_seconds
Optional[int]
Default ``retry_seconds`` override.
Default ` ` retry_seconds ` ` override .