Skip to content

Instantly share code, notes, and snippets.

@patrickkettner
Last active September 23, 2019 02:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patrickkettner/18f15b69db5add1adc42ef22e9038758 to your computer and use it in GitHub Desktop.
Save patrickkettner/18f15b69db5add1adc42ef22e9038758 to your computer and use it in GitHub Desktop.
Frigidaire.js
const Frigidaire = require('frigidaire');
const debug = require('debug')('frigidaire');
Frigidaire.prototype.DEHUMIDIFIER_MODE = 10002
Frigidaire.prototype.FAN_SPEED_ACTUAL = 10003
Frigidaire.prototype.FAN_SPEED_SETTING = 10004
Frigidaire.prototype.FILTER_STATUS = 10009
Frigidaire.prototype.FULL_BUCKET_INDICATOR = 10010
Frigidaire.prototype.HUMIDITY_SETTING = 10011
Frigidaire.prototype.HUMIDITY_ROOM = 10012
Frigidaire.prototype.DELAY_STOP_TIME = 10013
Frigidaire.prototype.SERVER_SOFTWARE_VRESION = 10016
Frigidaire.prototype.RUNNING_STATE = 10020
Frigidaire.prototype.DELAY_START_TIME = 10023
Frigidaire.prototype.POWER_ON = 5
Frigidaire.prototype.POWER_OFF = 0
Frigidaire.prototype.off = function(applianceId, callback) {
debug("changing mode for "+applianceId+" to off");
this.sendAction(applianceId, this.DEHUMIDIFIER_MODE, this.POWER_OFF, callback);
}
Frigidaire.prototype.on = function(applianceId, callback) {
debug("changing mode for "+applianceId+" to off");
this.sendAction(applianceId, this.DEHUMIDIFIER_MODE, this.POWER_ON, callback);
}
Frigidaire.prototype.fanSpeedLow = function(applianceId, callback) {
debug("changing fan speed for "+applianceId+" to low");
this.sendAction(applianceId, this.FAN_SPEED_SETTING, this.FANMODE_LOW, callback);
}
Frigidaire.prototype.fanSpeedHigh = function(applianceId, callback) {
debug("changing fan speed for "+applianceId+" to high");
this.sendAction(applianceId, this.FAN_SPEED_SETTING, this.FANMODE_HIGH, callback);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment