-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Corrected some logic errors and added support for the Kogan opener. T…
…he changes made were as follows. Added test for Kogan manufacturer and changed log messages prefix to TuyaAccessory with manufacturer name. Set the dpAction and dpStatus values based on the manufacturer. Changed _getCurrentDoorState to use dps or changes as the argument and test for a Kogan opener then return manufacturer-specific values. Added a debug flag (name/value pair in the configuration) and debug log function _debugLog(). Replaced all console.log() calls with _debugLog() calls. The debug flag values are true and false and default to false if not present in the configuration. Added the Kogan fopen and fclose commands to _getTargetDoorState. Changed calls to _getCurrentDoorState() to use the dpStatus value either directly or via dps[this.dpStatus] or changes[this.dpStatus] instead of dps and state. In _getTargetDoorState(), changed from Action values to Status values. Added a status variant with the correct spelling for 'opening' in case Kogan to decide to correct the incorrect spelling 'openning’. Corrected generic garage door to use true and false for open/close and opened/closed. Removed the code that infers for generic doors the opening and closing states from dpStatus and dpAction, as the dpAction value is now unavailable in _getCurrentDoorState().
- Loading branch information
1 parent
e2937d9
commit 82c6063
Showing
1 changed file
with
221 additions
and
17 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