Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix incorrect handling of openState in Contact Sensor (#1061)
## ♻️ Current situation The Contact Sensor has three states: `open`, `close`, and `timeOutNotClose`[^1]. `timeOutNotClose` indicating that the door/window has been open for an extended period. However, in the current implementation, the `timeOutNotClose` state is not handled correctly, causing the state to be incorrectly updated to `close`. ## 💡 Proposed solution I modified the handling so that `timeOutNotClose` behaves the same as `open` state, and I created a private function for shared handling to prevent future bugs. ## ⚙️ Release Notes - Fix incorrect handling of openState in Contact Sensor ## ➕ Additional Information ### Testing ### Reviewer Nudging [^1]: https://github.com/OpenWonderLabs/SwitchBotAPI/tree/main?tab=readme-ov-file#contact-sensor-1 Co-authored-by: Donavan Becker <beckersmarthome@icloud.com>
- Loading branch information