Resolve the max-hold threshold from env or default.
()
| 135 | |
| 136 | @staticmethod |
| 137 | def _max_hold_seconds() -> float: |
| 138 | """Resolve the max-hold threshold from env or default.""" |
| 139 | env = os.environ.get("FASTLED_LOCK_MAX_HOLD_S") |
| 140 | if env: |
| 141 | try: |
| 142 | return float(env) |
| 143 | except ValueError: |
| 144 | pass |
| 145 | return _DEFAULT_MAX_HOLD_S |
| 146 | |
| 147 | def _check_stale_lock(self) -> bool: |
| 148 | """Check if lock is stale and remove if so. |