new Nomiku()
Creates a new Nomiku adapter
Properties:
Name | Type | Description |
---|---|---|
STATE_ON |
String | The value to indicate that a unit is "ON" |
STATE_OFF |
String | The value to indicate that a unit is "OFF" |
STATE_OFFLINE |
String | The value to indicate that a unit is "OFFLINE" |
Methods
auth(email, password, cb)
Authenticates and grabs an access token
Parameters:
Name | Type | Description |
---|---|---|
email |
String | email to login to the Nomiku API with |
password |
String | password for the login |
cb |
authenticateCallback | The callback that handles the response. |
CtoF(c) → {Number}
Converts temperatures in Celcius to Farenheight
Parameters:
Name | Type | Description |
---|---|---|
c |
String | The temp value in degrees Celcius |
Returns:
The converted temperature in Farenheight
- Type
- Number
debug(arg)
Manually sets if debugging is on or off
Parameters:
Name | Type | Description |
---|---|---|
arg |
Boolean | The future state of the debugger's on state |
FtoC(f) → {Number}
Converts temperatures in Farenheight to Celcius
Parameters:
Name | Type | Description |
---|---|---|
f |
String | The temp value in degrees Farenheight |
Returns:
The converted temperature in Celcius
- Type
- Number
get(variableName, cb)
Grabs an arbitrary variable value
Parameters:
Name | Type | Description |
---|---|---|
variableName |
String | the variable name to grab |
cb |
getSetCallback | The callback that handles the response. |
getDevices(email, password, cb)
Authenticates and grabs an access token
Parameters:
Name | Type | Description |
---|---|---|
email |
String | email to login to the Nomiku API with |
password |
String | password for the login |
cb |
authenticateCallback | The callback that handles the response. |
getReceipeID(cb)
Grabs the most recent recipe ID
Parameters:
Name | Type | Description |
---|---|---|
cb |
getSetCallback | The callback that handles the response. |
getSetPoint(cb)
Grabs the most recent set point temperature in Celcius
Parameters:
Name | Type | Description |
---|---|---|
cb |
getSetCallback | The callback that handles the response. |
getState(cb)
Grabs the most recent state (0 = off, 1 = on, -1 = offline)
Parameters:
Name | Type | Description |
---|---|---|
cb |
getSetCallback | The callback that handles the response. |
getTemp(cb)
Grabs the most recent temperature in Celcius
Parameters:
Name | Type | Description |
---|---|---|
cb |
getSetCallback | The callback that handles the response. |
getToken() → {String}
Returns the current apiToken
Returns:
The current apiToken / access token
- Type
- String
getVersion(cb)
Grabs the most recent version
Parameters:
Name | Type | Description |
---|---|---|
cb |
getSetCallback | The callback that handles the response. |
set(variableName, value, cb)
Sets an arbitrary variable value
Parameters:
Name | Type | Description |
---|---|---|
variableName |
String | the variable name to set |
value |
String | the value to set the variable to |
cb |
getSetCallback | The callback that handles the response. |
setDebug(arg)
Manually sets if debugging is on or off
Parameters:
Name | Type | Description |
---|---|---|
arg |
Boolean | The future state of the debugger's on state |
setDeviceID(id) → {Boolean}
Manually sets the device ID
Parameters:
Name | Type | Description |
---|---|---|
id |
String | the device ID to use |
Returns:
true if a id is provided. False otherwise
- Type
- Boolean
setSetPoint(cb)
Sets the current temperature set point in Celcius of the device
Parameters:
Name | Type | Description |
---|---|---|
cb |
getSetCallback | The callback that handles the response. |
setState(cb)
Sets the current state of the device
Parameters:
Name | Type | Description |
---|---|---|
cb |
getSetCallback | The callback that handles the response. |
setToken(apiToken) → {Boolean}
Manually sets a token
Parameters:
Name | Type | Description |
---|---|---|
apiToken |
String | the API token to use |
Returns:
true if a token is provided. False otherwise
- Type
- Boolean
setUserID(id) → {Boolean}
Manually sets a userID
Parameters:
Name | Type | Description |
---|---|---|
id |
String | the user ID to use |
Returns:
true if a id is provided. False otherwise
- Type
- Boolean
Type Definitions
authenticateCallback(error)
Parameters:
Name | Type | Description |
---|---|---|
error |
Boolean | object | False if no error occured; an error obejct if an error did occur |
getSetCallback(error, value)
Parameters:
Name | Type | Description |
---|---|---|
error |
Boolean | object | False if no error occured; an error obejct if an error did occur |
value |
String | the value returned from the get request if an error did not occur |