Configuration constants and mappings require regular maintenance to stay aligned with evolving platform capabilities. Outdated configurations can introduce unnecessary complexity, while incomplete mappings can cause functionality loss.
Configuration constants and mappings require regular maintenance to stay aligned with evolving platform capabilities. Outdated configurations can introduce unnecessary complexity, while incomplete mappings can cause functionality loss.
Periodically audit configuration constants to:
Example of configuration constants that need review:
# Before: Manual unit conversion (now redundant)
DEVICE_CLASS_UNITS = {
"current": "mA", # Manual conversion from A to mA
}
# After: Let platform handle automatic conversions
DEVICE_CLASS_UNITS = {
"current": "A", # Use standard unit, let platform convert
}
# Ensure complete mappings to avoid losing device classes
DEVICE_CLASS_UNITS = {
"current": "A",
"duration": "min", # Add missing mappings
"voltage": "V",
}
This prevents bugs where valid configurations are incorrectly removed due to incomplete mappings, and eliminates maintenance overhead from obsolete manual conversions.
Enter the URL of a public GitHub repository