2025-05-25 02:18:22 +00:00
|
|
|
from platformio.package.meta import PackageSpec
|
2025-01-31 23:59:37 +00:00
|
|
|
Import('env')
|
|
|
|
|
|
|
|
|
2025-05-25 02:18:22 +00:00
|
|
|
libs = [PackageSpec(lib).name for lib in env.GetProjectOption("lib_deps",[])]
|
2025-01-31 23:59:37 +00:00
|
|
|
# Check for dependencies
|
2025-05-25 02:18:22 +00:00
|
|
|
if "Temperature" in libs:
|
2025-01-31 23:59:37 +00:00
|
|
|
env.Append(CPPDEFINES=[("USERMOD_DALLASTEMPERATURE")])
|
2025-05-25 02:18:22 +00:00
|
|
|
elif "sht" in libs:
|
2025-01-31 23:59:37 +00:00
|
|
|
env.Append(CPPDEFINES=[("USERMOD_SHT")])
|
2025-05-25 02:18:22 +00:00
|
|
|
elif "PWM_fan" in libs: # The script can be run if this module was previously selected
|
2025-01-31 23:59:37 +00:00
|
|
|
raise RuntimeError("PWM_fan usermod requires Temperature or sht to be enabled")
|