progressive_automations_python package#
Submodules#
progressive_automations_python.cli module#
progressive_automations_python.config module#
User-editable configuration for desk lifter control.
Edit these values during initial setup to match your hardware and requirements.
progressive_automations_python.desk_controller module#
progressive_automations_python.duty_cycle module#
Duty cycle management for motor protection.
Implements a 10% duty cycle (2 minutes on, 18 minutes off) using a sliding window approach. Tracks individual usage periods and enforces both continuous runtime and total usage limits.
- progressive_automations_python.duty_cycle.check_movement_against_duty_cycle(target_height: float, current_height: float | None = None, up_rate: float = 4.8, down_rate: float = 4.8) dict[source]#
Check if a movement to a target height would exceed duty cycle limits.
- Parameters:
target_height – Target height in mm/inches
current_height – Current height (if None, loads from state)
up_rate – Movement rate upward (mm/s or inches/s)
down_rate – Movement rate downward (mm/s or inches/s)
- Returns:
- {
“allowed”: bool, “error”: str or None, “estimated_duration”: float, “current_usage”: float, “remaining_capacity”: float, “movement_type”: “UP” or “DOWN”, “distance”: float
}
- Return type:
- progressive_automations_python.duty_cycle.clean_old_usage_periods(state: Dict[str, Any]) Dict[str, Any][source]#
Remove usage periods older than the duty cycle period
- progressive_automations_python.duty_cycle.get_current_duty_cycle_usage(state: Dict[str, Any]) float[source]#
Calculate current duty cycle usage in the sliding window
- progressive_automations_python.duty_cycle.get_duty_cycle_status(state: Dict[str, Any]) Dict[str, float][source]#
Get current duty cycle status information
- progressive_automations_python.duty_cycle.record_usage_period(state: Dict[str, Any], start_time: float, end_time: float) Dict[str, Any][source]#
Record a usage period in the duty cycle tracking