This repository has been archived by the owner on Jun 23, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor cover, fixing some bugs (#73)
Cover devices may or may not support setting their position (ie, an arbitrary value between 0 and 100) instead of just opening or closing. Before this change, it was assumed that rollershutters could have their set, but garage doors could not. This is not correct. This refactors the cover accessory to make this separation more clear. Instead of if statements scattered through the code, we build a class hierarchy to clearly separate garage doors and rollershutters - of the "binary" type, and the type we previously assumed all were. At the same time, I moved all of the logic for choosing the cover type into the cover factory, instead of doing it all in index.js
- Loading branch information
1 parent
30eac06
commit 4cd3926
Showing
2 changed files
with
156 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters