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

Use deviceTypeVersion returned from API #1

Merged
merged 1 commit into from
Jul 8, 2023

Conversation

Taik
Copy link

@Taik Taik commented Jun 30, 2023

This PR records the deviceTypeVersion value when populating device info object from the returned from the /web/devices endpoint, and uses it when sending commands.

I've tested this locally via node demo.js and all commands seems to be working. Apologies ahead of time for the big diff -- the majority of the changes are just from prettier running.

Some background context:

For newer Mr. Cool Split Units, the deviceTypeVersion is different than what is originally hard-coded (BP01). For my device, BP04 is sent.

Here's a sample actionControl command payload:

{
  "action": "actionControl",
  "macAddress": "34945460CE2A",
  "deviceTypeVersion": "BI04", // <-- specifically this
  "fwVersion": "2.6.0,2.6.0",
  "actionSource": "WEB",
  "applianceType": "AC",
  "applianceId": 1663,
  "actionType": "temp",
  "actionValue": 80,
  "connection_source": 2,
  "token": "__REDACTED__",
  "actions": {
    "power": "on",
    "mode": "cool",
    "fanspeed": "auto",
    "temp": "80",
    "swing": "auto",
    "turbo": "off",
    "light": "off",
    "oldPower": "on"
  },
  "mid": "chrome-1688162917",
  "application_version": "1.0.0",
  "ts": 1688164168
}
image

@Taik Taik force-pushed the thinh--fix-deviceTypeVersion branch from c58d1fd to a0089e4 Compare June 30, 2023 22:45
mid: this.#sessionID,
token: this.#accessToken,
application_version: "1.0.0",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The majority of these changes are me re-ordering the fields around to align to the same ordering of fields sent from the dashboard.

actionSource: 'WEB',
action: "actionControl",
macAddress: hvac.getMacAddress(),
deviceTypeVersion: hvac.getDeviceTypeVersion() || "BI01",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plumbing this from hvac object.

@@ -86,12 +86,13 @@ class CieloAPIConnection {
device.deviceName,
device.applianceId,
device.fwVersion,
device.deviceTypeVersion
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recording the value gotten from the API to the local HVAC object.

@Taik Taik changed the title Use deviceTypeVersion returned from Use deviceTypeVersion returned from API Jun 30, 2023
@ryanfroese
Copy link
Owner

@Taik , thanks for picking this up! Work has been nuts for me recently, hence my radio-silence.

These changes are what I was hoping for, it was tricky for me to test/discover of the the device specific differences since I only have one type of Cielo device at my house.

@ryanfroese ryanfroese merged commit ce1bb60 into ryanfroese:master Jul 8, 2023
@Taik Taik deleted the thinh--fix-deviceTypeVersion branch July 13, 2023 04:56
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.

None yet

2 participants