@@ -253,18 +253,27 @@ const uint16_t kMinUnknownSize = 2 * 10;
253
253
#define KEY_JSON "json"
254
254
#define KEY_RESEND "resend"
255
255
#define KEY_VCC "vcc"
256
+ #define KEY_COMMAND "command"
257
+ #define KEY_SENSORTEMP "sensortemp"
258
+ #define KEY_IFEEL "ifeel"
256
259
257
260
// HTML arguments we will parse for IR code information.
258
261
#define KEY_TYPE "type" // KEY_PROTOCOL is also checked too.
259
262
#define KEY_CODE "code"
260
263
#define KEY_BITS "bits"
261
264
#define KEY_REPEAT "repeats"
262
265
#define KEY_CHANNEL "channel" // Which IR TX channel to send on.
266
+ #define KEY_SENSORTEMP_DISABLED "sensortemp_disabled" // For HTML form only,
267
+ // not sent via MQTT
268
+ // nor JSON
263
269
264
270
// GPIO html/config keys
265
271
#define KEY_TX_GPIO "tx"
266
272
#define KEY_RX_GPIO "rx"
267
273
274
+ // Miscellaneous constants
275
+ #define TOGGLE_JS_FN_NAME "ToggleInputBasedOnCheckbox"
276
+
268
277
// Text for Last Will & Testament status messages.
269
278
const char * const kLwtOnline = "Online" ;
270
279
const char * const kLwtOffline = "Offline" ;
@@ -290,7 +299,7 @@ const uint16_t kJsonAcStateMaxSize = 1024; // Bytes
290
299
// ----------------- End of User Configuration Section -------------------------
291
300
292
301
// Constants
293
- #define _MY_VERSION_ "v1.7.2 "
302
+ #define _MY_VERSION_ "v1.8.0 "
294
303
295
304
const uint8_t kRebootTime = 15 ; // Seconds
296
305
const uint8_t kQuickDisplayTime = 2 ; // Seconds
@@ -358,7 +367,8 @@ static const char kClimateTopics[] PROGMEM =
358
367
"(" KEY_PROTOCOL "|" KEY_MODEL "|" KEY_POWER "|" KEY_MODE "|" KEY_TEMP "|"
359
368
KEY_FANSPEED "|" KEY_SWINGV "|" KEY_SWINGH "|" KEY_QUIET "|"
360
369
KEY_TURBO "|" KEY_LIGHT "|" KEY_BEEP "|" KEY_ECONO "|" KEY_SLEEP "|"
361
- KEY_FILTER "|" KEY_CLEAN "|" KEY_CELSIUS "|" KEY_RESEND
370
+ KEY_FILTER "|" KEY_CLEAN "|" KEY_CELSIUS "|" KEY_RESEND "|" KEY_COMMAND "|"
371
+ "|" KEY_SENSORTEMP "|" KEY_IFEEL
362
372
#if MQTT_CLIMATE_JSON
363
373
"|" KEY_JSON
364
374
#endif // MQTT_CLIMATE_JSON
@@ -367,6 +377,7 @@ static const char* const kMqttTopics[] = {
367
377
KEY_PROTOCOL , KEY_MODEL , KEY_POWER , KEY_MODE , KEY_TEMP , KEY_FANSPEED ,
368
378
KEY_SWINGV , KEY_SWINGH , KEY_QUIET , KEY_TURBO , KEY_LIGHT , KEY_BEEP ,
369
379
KEY_ECONO , KEY_SLEEP , KEY_FILTER , KEY_CLEAN , KEY_CELSIUS , KEY_RESEND ,
380
+ KEY_COMMAND , KEY_SENSORTEMP , KEY_IFEEL
370
381
KEY_JSON }; // KEY_JSON needs to be the last one.
371
382
372
383
@@ -410,17 +421,22 @@ int8_t getDefaultTxGpio(void);
410
421
String genStatTopic (const uint16_t channel = 0 );
411
422
String listOfTxGpios (void );
412
423
bool hasUnsafeHTMLChars (String input );
413
- String htmlHeader (const String title , const String h1_text = "" );
424
+ String htmlHeader (const String title , const String h1_text = "" ,
425
+ const String headScriptsJS = "" );
414
426
String htmlEnd (void );
415
427
String htmlButton (const String url , const String button ,
416
428
const String text = "" );
417
429
String htmlMenu (void );
418
430
void handleRoot (void );
419
431
String addJsReloadUrl (const String url , const uint16_t timeout_s ,
420
432
const bool notify );
433
+ String getJsToggleCheckbox (const String functionName = TOGGLE_JS_FN_NAME );
421
434
void handleExamples (void );
422
435
String htmlOptionItem (const String value , const String text , bool selected );
423
436
String htmlSelectBool (const String name , const bool def );
437
+ String htmlDisableCheckbox (const String name , const String targetControlId ,
438
+ const bool checked ,
439
+ const String toggleJsFnName = TOGGLE_JS_FN_NAME );
424
440
String htmlSelectClimateProtocol (const String name , const decode_type_t def );
425
441
String htmlSelectAcStateProtocol (const String name , const decode_type_t def ,
426
442
const bool simple );
0 commit comments