pi_portal.modules.integrations.gpio.components.dht11_sensor.DHT11
- class pi_portal.modules.integrations.gpio.components.dht11_sensor.DHT11(pin_number: int, pin_name: str)[source]
Bases:
TemperatureSensorBase[<Mock name=’mock.DHT11’ id=’140225002686640’>]DHT11 Temperature Sensor class.
- Param:
pin_number: The GPIO input number.
- Parameters:
pin_name – The name of this sensor in alerts and logs.
- __init__(pin_number: int, pin_name: str) None
- has_changed() bool
Query the state to see if it has changed since the last poll.
- Returns:
A boolean indicating if the state has changed.
- Return type:
bool
- hook_board_pin() Any[source]
Retrieve the hardware location of the GPIO pin.
- Returns:
The hardware pin location.
- Return type:
Any
- hook_setup_hardware() <Mock name='mock.DHT11' id='140225002686640'>[source]
Retrieve the adafruit_dht sensor object for the DHT11.
- Returns:
The hardware sensor interface.
- Return type:
<Mock name=’mock.DHT11’ id=’140225002686640’>
- hook_setup_input() None
Override to initialize the GPIO input. This is optional.
- hook_update_state(retries: int = 3) TypeTemperatureData[source]
Retrieve new state for the GPIO input. :param retries: The number of times to retry a failed sensor reading.
- Returns:
The new GPIO state value.
- Return type:
- poll() None
Update the state of the GPIO input.
- property sensor_type: str
Returns the name of the input type. The default behaviour is to return the implementation’s class name.
- Returns:
The input’s name.