Fork of the espurna firmware for `mhsw` switches
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

113 lines
5.5 KiB

  1. //--------------------------------------------------------------------------------
  2. // PROGMEM definitions
  3. //--------------------------------------------------------------------------------
  4. //--------------------------------------------------------------------------------
  5. // Reset reasons
  6. //--------------------------------------------------------------------------------
  7. PROGMEM const char custom_reset_hardware[] = "Hardware button";
  8. PROGMEM const char custom_reset_web[] = "Reboot from web interface";
  9. PROGMEM const char custom_reset_terminal[] = "Reboot from terminal";
  10. PROGMEM const char custom_reset_mqtt[] = "Reboot from MQTT";
  11. PROGMEM const char custom_reset_rpc[] = "Reboot from RPC";
  12. PROGMEM const char custom_reset_ota[] = "Reboot after successful OTA update";
  13. PROGMEM const char custom_reset_http[] = "Reboot from HTTP";
  14. PROGMEM const char custom_reset_nofuss[] = "Reboot after successful NoFUSS update";
  15. PROGMEM const char custom_reset_upgrade[] = "Reboot after successful web update";
  16. PROGMEM const char custom_reset_factory[] = "Factory reset";
  17. PROGMEM const char* const custom_reset_string[] = {
  18. custom_reset_hardware, custom_reset_web, custom_reset_terminal,
  19. custom_reset_mqtt, custom_reset_rpc, custom_reset_ota,
  20. custom_reset_http, custom_reset_nofuss, custom_reset_upgrade,
  21. custom_reset_factory
  22. };
  23. //--------------------------------------------------------------------------------
  24. // Sensors
  25. //--------------------------------------------------------------------------------
  26. #if SENSOR_SUPPORT
  27. PROGMEM const unsigned char magnitude_decimals[] = {
  28. 0,
  29. 1, 0, 2,
  30. 3, 0, 0, 0, 0, 0, 0, 0,
  31. 0, 0, 0,
  32. 0, 0, 0,
  33. 0, 0, 3, 3,
  34. 4, 4 // Geiger Counter decimals
  35. };
  36. PROGMEM const char magnitude_unknown_topic[] = "unknown";
  37. PROGMEM const char magnitude_temperature_topic[] = "temperature";
  38. PROGMEM const char magnitude_humidity_topic[] = "humidity";
  39. PROGMEM const char magnitude_pressure_topic[] = "pressure";
  40. PROGMEM const char magnitude_current_topic[] = "current";
  41. PROGMEM const char magnitude_voltage_topic[] = "voltage";
  42. PROGMEM const char magnitude_active_power_topic[] = "power";
  43. PROGMEM const char magnitude_apparent_power_topic[] = "apparent";
  44. PROGMEM const char magnitude_reactive_power_topic[] = "reactive";
  45. PROGMEM const char magnitude_power_factor_topic[] = "factor";
  46. PROGMEM const char magnitude_energy_topic[] = "energy";
  47. PROGMEM const char magnitude_energy_delta_topic[] = "energy_delta";
  48. PROGMEM const char magnitude_analog_topic[] = "analog";
  49. PROGMEM const char magnitude_digital_topic[] = "digital";
  50. PROGMEM const char magnitude_events_topic[] = "events";
  51. PROGMEM const char magnitude_pm1dot0_topic[] = "pm1dot0";
  52. PROGMEM const char magnitude_pm2dot5_topic[] = "pm2dot5";
  53. PROGMEM const char magnitude_pm10_topic[] = "pm10";
  54. PROGMEM const char magnitude_co2_topic[] = "co2";
  55. PROGMEM const char magnitude_lux_topic[] = "lux";
  56. PROGMEM const char magnitude_uv_topic[] = "uv";
  57. PROGMEM const char magnitude_distance_topic[] = "distance";
  58. PROGMEM const char magnitude_hcho_topic[] = "hcho";
  59. PROGMEM const char magnitude_geiger_cpm_topic[] = "ldr_cpm"; // local dose rate [Counts per minute]
  60. PROGMEM const char magnitude_geiger_sv_topic[] = "ldr_uSvh"; // local dose rate [µSievert per hour]
  61. PROGMEM const char* const magnitude_topics[] = {
  62. magnitude_unknown_topic, magnitude_temperature_topic, magnitude_humidity_topic,
  63. magnitude_pressure_topic, magnitude_current_topic, magnitude_voltage_topic,
  64. magnitude_active_power_topic, magnitude_apparent_power_topic, magnitude_reactive_power_topic,
  65. magnitude_power_factor_topic, magnitude_energy_topic, magnitude_energy_delta_topic,
  66. magnitude_analog_topic, magnitude_digital_topic, magnitude_events_topic,
  67. magnitude_pm1dot0_topic, magnitude_pm2dot5_topic, magnitude_pm10_topic,
  68. magnitude_co2_topic, magnitude_lux_topic, magnitude_uv_topic,
  69. magnitude_distance_topic, magnitude_hcho_topic,
  70. magnitude_geiger_cpm_topic, magnitude_geiger_sv_topic // Geiger Counter topics
  71. };
  72. PROGMEM const char magnitude_empty[] = "";
  73. PROGMEM const char magnitude_celsius[] = "°C";
  74. PROGMEM const char magnitude_fahrenheit[] = "°F";
  75. PROGMEM const char magnitude_percentage[] = "%";
  76. PROGMEM const char magnitude_hectopascals[] = "hPa";
  77. PROGMEM const char magnitude_amperes[] = "A";
  78. PROGMEM const char magnitude_volts[] = "V";
  79. PROGMEM const char magnitude_watts[] = "W";
  80. PROGMEM const char magnitude_kw[] = "kW";
  81. PROGMEM const char magnitude_joules[] = "J";
  82. PROGMEM const char magnitude_kwh[] = "kWh";
  83. PROGMEM const char magnitude_ugm3[] = "µg/m³";
  84. PROGMEM const char magnitude_ppm[] = "ppm";
  85. PROGMEM const char magnitude_lux[] = "lux";
  86. PROGMEM const char magnitude_uv[] = "uv";
  87. PROGMEM const char magnitude_distance[] = "m";
  88. PROGMEM const char magnitude_mgm3[] = "mg/m³";
  89. PROGMEM const char magnitude_geiger_cpm[] = "cpm"; // Counts per Minute: Unit of local dose rate (Geiger counting)
  90. PROGMEM const char magnitude_geiger_sv[] = "µSv/h"; // µSievert per hour: 2nd unit of local dose rate (Geiger counting)
  91. PROGMEM const char* const magnitude_units[] = {
  92. magnitude_empty, magnitude_celsius, magnitude_percentage,
  93. magnitude_hectopascals, magnitude_amperes, magnitude_volts,
  94. magnitude_watts, magnitude_watts, magnitude_watts,
  95. magnitude_percentage, magnitude_joules, magnitude_joules,
  96. magnitude_empty, magnitude_empty, magnitude_empty,
  97. magnitude_ugm3, magnitude_ugm3, magnitude_ugm3,
  98. magnitude_ppm, magnitude_lux, magnitude_uv,
  99. magnitude_distance, magnitude_mgm3,
  100. magnitude_geiger_cpm, magnitude_geiger_sv // Geiger counter units
  101. };
  102. #endif