Skip to content
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

Add binary control support #16

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ncovercash
Copy link

Certain kinds of equipment use a binary string instead of key/value pairs to set data.

You can see a detailed example in sampsyo/wideq#12. This string is dynamically generated based on the model's information, therefore, is also more natural and easier to use.

As my refrigerator uses these types of commands, I implemented methods of RefrigeratorDevice which take advantage of this control method. The old ones are left as-is (not renamed) for backwards compatibility. In the future, I would recommend prefixing them with "setKey" for clarity. I plan on making a PR to NorDroN/homebridge-wideq soon which allows setting which mode to use (for different kinds of hardware).

This creates a buffer containing the binary information needed to control certain devices.  It looks like the initial PR for this (ssut#5) was for a unit which supported certain string-based commands – this is not the case with mine and others (per related sampsyo/wideq#12).  This is a dynamic method which will build up the binary control string from the specification and current Status object.
This implements a special rti/rtiControl request where the control data is sent as a b64 string, rather than a more standard key/value methodology.

See sampsyo/wideq#12 for more information about this spec/request.
The old ones are left as-is (not renamed) for backwards compatibility.  In the future, I would recommend prefixing them with "setKey" for clarity.

These new methods take advantage of the setDeviceControlBinary methods and control refrigerators that use binary control.
@ncovercash ncovercash mentioned this pull request May 8, 2020
@ncovercash
Copy link
Author

Oops, just realized I left some extra console print statements in there. Fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant