My general approach would be to bin parameters into categories of "Hardware Calibration" (HC) vs. "Control Inputs" (CI).
HC items are items that need to be adjusted during initial installation or when modifying hardware. These events should be rare, so specifying them in the sketch makes sense.
CI items are things that users would want to adjust manually or via automation on a more frequent basis, so they should be accessible in the hubitat driver.
Personal preference and usage case creates some gray zone between these categories. In those cases, I would lean toward binning as CI.
Here's my preference given the two commonly discussed applications, blinds and damper control.
HC parameters set up in sketch:
- End point mapping. This should be set it and leave it. If it is open to the Hubitat driver, risk for inadvertent changes that could cause servo overload and damage are too high. For ease of setup without compiling the sketch repeatedly, I recommend keeping the degree output that is currently visible in the Hubitat device. During setup, the sketch can be compiled with level 0-100 mapped to 0-180 degrees and initial position 50. Manual adjustment of level in the Hubitat driver can be performed for each endpoint without recompiling the sketch. The corresponding degrees reading can be observed in the device driver, then used for remapping in the sketch. Two rounds of sketch compiling should get the setup done.
- non linear mapping coefficients.
- initial position (as a level, not degrees)
- detach flag
CI parameters set up in Hubitat driver:
- optional over ride of initial position (this one is in the gray zone)
- level input
- duration as time desired for the move to be completed. Make the default 0 so the servo moves as fast as it can under load. Allow user input to select a slower transition duration in seconds. If selected, detach would occur immediately after transition completion.