forked from MrTomAsh/homebridge-ewelink
-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A big one - Refactoring & WebSocket Client Improvements #114
Open
dhutchison
wants to merge
23
commits into
howanghk:master
Choose a base branch
from
dhutchison:refactor
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,291
−1,743
Conversation
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
Put the lan client behind an experimentalLanClient configuration setting
Still needs integrated & tested
Seperating out API interaction code into seperate class
…et or http Also fixes some bugs in previous commits, adds logging
…a login operation has occurred
Uses a promise based approach to get the current device state for a device.
Also added a test call to the lan client to check promise approach works. Still more work to do in this area.
…nd instead of recieve
… authentication token
Calling getDeviceStatus too quick results in errors, slowing down a bit.
Focus on Fan device testing with a fake device
Wow thank you @dhutchison ! That's a lot of hard work! It would take some time for me to review this before merging. |
Any tentative date for merging this? |
Hi @prasad-edlabadka please try https://github.com/bwp91/homebridge-ewelink which is more active and better. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a much bigger set of changes than I was intending to include in a single PR, but here it goes. I think it is time to start getting these changes looked at by a wider group. Ideally we can get these tested & merged in.
This has done a pile of refactoring to remove duplication in the plugin for how it was reading the status for devices. As part of this, and adding experimental support for getting the device status with WebSockets (#74), the approach to loading data has been separated out. In lib, there is now an
api.js
file which handles all the API operations which the plugin was performing. This then internally deals with working out what needs to go to the REST, WebSockets and Lan mode APIs depending on the feature flags enabled.These feature flags are now documented in the README file, which is worth reading to get a feel for the changes being introduced.
There is also an additional
fakeFan
setting which I have been using to allow testing of Fan type devices. This refactoring has removed a lot of duplication in how the fan Active and Light statuses were being loaded, as these were just switches.This has introduced for the LAN and WebSocket clients caching of device status information (albeit for a short period for the latter), which should help with issues where the websocket is closed due to too many quick requests being made for the same device.
The main area I have been unable to test changes in is for Blinds, so hoping someone is able to try some pre-release code to check if my branch functions.