# ------------------------------------------------------------
# Copyright © 2026/2027 Dr. Mohammad Alja'afreh. All rights reserved.
# PSUT IoT Engineering Learning Platform
# ------------------------------------------------------------
# ---- On the real Pi: replace MockSensors.read() with real sensors
#      pip install adafruit-circuitpython-dht   (and: sudo apt install libgpiod2)
import adafruit_dht, board

dht = adafruit_dht.DHT22(board.D4)              # DHT22 data pin on GPIO4

def read() -> dict:
    return {"temperature": float(dht.temperature),   # float, never int: keep the field type
            "humidity": float(dht.humidity),
            "soil_moisture": read_soil_percent()}    # your ADC code (e.g. ADS1115 over I²C)
