33#
44# Temboo Arduino library
55#
6- # Copyright 2015 , Temboo Inc.
6+ # Copyright 2017 , Temboo Inc.
77#
88# Licensed under the Apache License, Version 2.0 (the "License");
99# you may not use this file except in compliance with the License.
@@ -121,6 +121,21 @@ void TembooChoreo::setProfile(const char* profileName) {
121121 m_preset.put (profileName);
122122}
123123
124+ void TembooChoreo::setDeviceType (const String& deviceType) {
125+ m_deviceType.put (deviceType.c_str ());
126+ }
127+
128+ void TembooChoreo::setDeviceType (const char * deviceType) {
129+ m_deviceType.put (deviceType);
130+ }
131+
132+ void TembooChoreo::setDeviceName (const String& deviceName) {
133+ m_deviceName.put (deviceName.c_str ());
134+ }
135+
136+ void TembooChoreo::setDeviceName (const char * deviceName) {
137+ m_deviceName.put (deviceName);
138+ }
124139
125140void TembooChoreo::addInput (const String& inputName, const String& inputValue) {
126141 m_inputs.put (inputName.c_str (), inputValue.c_str ());
@@ -141,6 +156,33 @@ void TembooChoreo::addInput(const String& inputName, const char* inputValue) {
141156 m_inputs.put (inputName.c_str (), inputValue);
142157}
143158
159+ void TembooChoreo::addInputExpression (const String& inputName, const String& inputValue) {
160+ m_expressions.put (inputName.c_str (), inputValue.c_str ());
161+ }
162+
163+ void TembooChoreo::addInputExpression (const char * inputName, const String& inputValue) {
164+ m_expressions.put (inputName, inputValue.c_str ());
165+ }
166+
167+ void TembooChoreo::addInputExpression (const char * inputName, const char * inputValue) {
168+ m_expressions.put (inputName, inputValue);
169+ }
170+
171+ void TembooChoreo::addSensorInput (const char * sensorName, int sensorValue, const char * conversion) {
172+ m_sensors.put (sensorName, sensorValue, conversion, NULL , NULL , NULL , NULL , NULL );
173+ }
174+
175+ void TembooChoreo::addSensorInput (const char * sensorName, int sensorValue) {
176+ m_sensors.put (sensorName, sensorValue, NULL , NULL , NULL , NULL , NULL , NULL );
177+ }
178+
179+ void TembooChoreo::addSensorInput (const char * sensorName, int sensorValue, const char * conversion, const char * calibrationValue) {
180+ m_sensors.put (sensorName, sensorValue, conversion, NULL , NULL , NULL , NULL , calibrationValue);
181+ }
182+
183+ void TembooChoreo::addSensorInput (const char * sensorName, int sensorValue, const char * rawLow, const char * rawHigh, const char * scaleLow, const char * scaleHigh) {
184+ m_sensors.put (sensorName, sensorValue, NULL , rawLow, rawHigh, scaleLow, scaleHigh, NULL );
185+ }
144186
145187void TembooChoreo::addOutputFilter (const char * outputName, const char * filterPath, const char * variableName) {
146188 m_outputs.put (outputName, filterPath, variableName);
@@ -219,7 +261,7 @@ int TembooChoreo::run(IPAddress addr, uint16_t port, uint16_t timeoutSecs) {
219261
220262 for (int i = 0 ; i < 2 ; i++) {
221263 unsigned long timeoutBeginSecs = session.getTime ();
222- if (0 != session.executeChoreo (m_accountName, m_appKeyName, m_appKeyValue, m_path, m_inputs, m_outputs, m_preset)) {
264+ if (0 != session.executeChoreo (m_accountName, m_appKeyName, m_appKeyValue, m_path, m_inputs, m_expressions, m_sensors, m_outputs, m_preset, m_deviceType, m_deviceName )) {
223265 httpCode = 0 ;
224266 break ;
225267 }
0 commit comments