pi_portal.modules.integrations.gpio.components.dht11_sensor

DHT11 class.

class pi_portal.modules.integrations.gpio.components.dht11_sensor.DHT11(pin_number, pin_name)[source]

DHT11 Temperature Sensor class.

Param:

pin_number: The GPIO input number.

Parameters:
  • pin_name (str) – The name of this door in alerts and logs.

  • pin_number (int) –

has_changed()

Query the state to see if it has changed since the last poll.

Return type:

bool

Returns:

A boolean indicating if the state has changed.

hook_board_pin()[source]

Retrieve the hardware location of the GPIO pin.

Return type:

Any

Returns:

The hardware pin location.

hook_setup_hardware()[source]

Retrieve the adafruit_dht sensor object for the DHT11.

Return type:

Any

Returns:

The hardware sensor interface.

hook_setup_input()

Override to initialize the GPIO input. This is optional.

Return type:

None

Returns:

The new GPIO state value.

hook_update_state(retries=3)[source]

Retrieve new state for the GPIO input. :type retries: int, default: 3 :param retries: The number of times to retry a failed sensor reading.

Return type:

TypeTemperatureData

Returns:

The new GPIO state value.

Raises:

RuntimeError

poll()

Update the state of the GPIO input.

Return type:

None

property sensor_type: str

Returns the name of the input type. The default behaviour is to return the implementation’s class name.

Returns:

The inputs name.