Skip to content

Remove unused module-level constants#396

Merged
sebr merged 2 commits intomainfrom
chore/switch-cleanup-unused-attrs
Apr 19, 2026
Merged

Remove unused module-level constants#396
sebr merged 2 commits intomainfrom
chore/switch-cleanup-unused-attrs

Conversation

@sebr
Copy link
Copy Markdown
Owner

@sebr sebr commented Apr 19, 2026

Summary

Audited every module in custom_components/bhyve/ for module-level constants with zero references anywhere in the codebase (including tests). Removed the dead ones.

  • switch.py: DEFAULT_MANUAL_RUNTIME, PROGRAM_SMART_WATERING, PROGRAM_MANUAL, ATTR_MANUAL_RUNTIME, ATTR_SMART_WATERING_ENABLED, ATTR_SPRINKLER_TYPE, ATTR_IMAGE_URL, ATTR_STARTED_WATERING_AT, ATTR_SMART_WATERING_PLAN, ATTR_CURRENT_STATION, ATTR_CURRENT_PROGRAM, ATTR_CURRENT_RUNTIME, ATTR_NEXT_START_TIME, ATTR_NEXT_START_PROGRAMS, ATTR_MINUTES, ATTR_HOURS, ATTR_PERCENTAGE, ATTR_PROGRAM, plus the timedelta import
  • const.py: DEVICES, PROGRAMS, DATA_BHYVE, SIGNAL_UPDATE_DEVICE, SIGNAL_UPDATE_PROGRAM, TYPE_BINARY_SENSOR, TYPE_SENSOR
  • diagnostics.py: CONF_ALTITUDE, CONF_UUID
  • valve.py: PROGRAM_SMART_WATERING, PROGRAM_MANUAL

Most were left over from the zone switch → valve migration. No runtime behaviour changes.

Test plan

  • ./scripts/test — 142 passed
  • ./scripts/lint — all checks passed

sebr added 2 commits April 19, 2026 03:49
These attribute/program constants were left over from when the zone
switch lived in switch.py; they all now live in valve.py. Removing them
also drops the now-unused timedelta import and DEFAULT_MANUAL_RUNTIME.
Audited remaining modules and dropped constants that no code references:
- const: DEVICES, PROGRAMS, DATA_BHYVE, SIGNAL_UPDATE_DEVICE,
  SIGNAL_UPDATE_PROGRAM, TYPE_BINARY_SENSOR, TYPE_SENSOR
- diagnostics: CONF_ALTITUDE, CONF_UUID
- valve: PROGRAM_SMART_WATERING, PROGRAM_MANUAL
@sebr sebr changed the title Remove unused module-level constants from switch.py Remove unused module-level constants Apr 19, 2026
@sebr sebr merged commit 0b9c7f0 into main Apr 19, 2026
4 checks passed
@sebr sebr deleted the chore/switch-cleanup-unused-attrs branch April 19, 2026 04:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant