3#ifndef PreferencesController_h
4#define PreferencesController_h
7#define STEPPER_IS_UNO 1
8#define STEPPER_IS_MINI 2
9#define STEPPER_IS_TUMBLER 3
12#define PREFERENCE_MAIN_GATEWAY_VALUE 0
13#define PREFERENCE_MAIN_BLE_SERVER_VALUE 1
14#define PREFERENCE_MAIN_BLE_CLIENT_VALUE 2
17#define PREFERENCE_STEPPER_BUZZER_VALUE 3
19#define PREFERENCE_STEPPER_SINGLE_FEED_VALUE 4
20#define PREFERENCE_STEPPER_AUTO_FEED_VALUE 5
21#define PREFERENCE_STEPPER_JACKPOT_FEED_VALUE 6
22#define PREFERENCE_STEPPER_ANGLE_FLOAT_SETTING 7
24#define PREFERENCE_STEPPER_KIND_VALUE 8
25#define PREFERENCE_STEPPER_FEEDS_PER_JACKPOT 9
28#define PREFERENCE_SENSOR_TILT_VALUE 10
29#define PREFERENCE_SENSOR_PIR_VALUE 11
31#define PREFERENCE_SEMANTIC_MARKER_ZOOMED_VALUE 12
33#define PREFERENCE_DISPLAY_ON_BLANK_SCREEN_VALUE 13
35#define PREFERENCE_DISPLAY_SCREEN_TIMEOUT_VALUE 14
37#define PREFERENCE_HIGH_TEMP_POWEROFF_VALUE 15
39#define PREFERENCE_IS_MINIMAL_MENU_SETTING 16
43#define PREFERENCE_NO_BUTTON_CLICK_POWEROFF_SETTING 17
46#define WIFI_CREDENTIALS_MAX 2
47#define PREFERENCE_WIFI_CREDENTIAL_1_SETTING 18
48#define PREFERENCE_WIFI_CREDENTIAL_2_SETTING 19
50#define PREFERENCE_PAIRED_DEVICE_SETTING 20
52#define PREFERENCE_DEVICE_NAME_SETTING 21
54#define PREFERENCE_FIRST_TIME_FEATURE_SETTING 22
56#define PREFERENCE_ONLY_GEN3_CONNECT_SETTING 23
58#define PREFERENCE_SCREEN_COLOR_SETTING 24
61#define PREFERENCE_BLE_SERVER_USE_DEVICE_NAME_SETTING 25
64#define PREFERENCE_BLE_USE_DISCOVERED_PAIRED_DEVICE_SETTING 26
66#define PREFERENCE_USE_DOC_FOLLOW_SETTING 27
69#define PREFERENCE_SUB_DAWGPACK_SETTING 28
71#define PREFERENCE_USE_SPIFF_SETTING 29
74#define PREFERENCE_PAIRED_DEVICE_ADDRESS_SETTING 30
82#define PREFERENCE_STEPPER_FACTORY_CLOCKWISE_MOTOR_DIRECTION_SETTING 31
85#define PREFERENCE_SENDWIFI_WITH_BLE 32
88#define PREFERENCE_NOTIFY_BLE_DISCOVERY 33
91#define PREFERENCE_TIMER_INT_SETTING 34
94#define PREFERENCE_SUPPORT_GROUPS_SETTING 35
98#define PREFERENCE_GROUP_NAMES_SETTING 36
101#define PREFERENCE_DEBUG_INFO_SETTING 37
106#define PREFERENCE_DEV_ONLY_SM_SETTING 38
109#define PREFERENCE_TIMER_MAX_INT_SETTING 39
112#define PREFERENCE_ATOMS_SETTING 40
115#define PREFERENCE_ATOM_KIND_SETTING 41
118#define PREFERENCE_SM_ON_PIR_SETTING 42
120#define PREFERENCE_SM_COMMAND_PIR_SETTING 43
122#define PREFERENCE_SM_COMMAND_PIR_OFF_SETTING 44
124#define PREFERENCE_ATOM_SOCKET_GLOBAL_ONOFF_SETTING 45
128#define PREFERENCE_USE_SPIFF_MQTT_SETTING 46
130#define PREFERENCE_USE_SPIFF_QRATOM_SETTING 47
136#define PREFERENCE_STEPPER_AUTO_MOTOR_DIRECTION_SETTING 48
139#define PREFERENCE_INCLUDE_GROUP_NAMES_SETTING 49
145#define PREFERENCE_STEPPER_CLOCKWISE_MOTOR_DIRECTION_SETTING 50
149#define PREFERENCE_SENSOR_PLUGS_SETTING 51
154#define PREFERENCE_SENSORS_SETTING 52
159#define PREFERENCE_STEPPER_RPM_SETTING 53
162#define MAX_MAIN_PREFERENCES 54
254#pragma mark ATOM Processing
262#define ATOM_KIND_M5_SCANNER 0
263#define ATOM_KIND_M5_SOCKET 1
269#define NEW_SENSORS_PREFERENCE
271#include "../SensorClass/SensorClassType.h"
struct sensorsStruct SensorsStruct
wrap sensors
void savePreferenceInt_mainModule(int preferenceID, int val)
sets an int
boolean getDiscoverM5PTClicker()
get option
void resetSensorToDefault_mainModule()
float getPreferenceFloat_mainModule(int preferenceID)
called to get a preference (which will be an identifier and a string, which can be converted to a num...
void savePreferenceBoolean_mainModule(int preferenceID, boolean flag)
save a boolean preference
void savePreferenceATOMKind_MainModule(String value)
new 1.4.24 setting ATOM kind (eg. M5AtomSocket, M5AtomScanner). MQTT message "set":"M5AtomKind",...
void printSensors_mainModule(SensorsStruct *sensors)
print sensors, passing in a struct
SensorsStruct * getSensors_mainModule()
return the sensor specified or null
void appendPreference_mainModule(int preferenceID, String preferenceValue)
called to append to a a preference (which will be an identifier and a string, which can be converted ...
void setDiscoverM5PTClicker(boolean flag)
void setSensorsString_mainModule(char *sensorsString)
void resetAllPreferences_mainModule()
resets preferences.. Currently only reset all, but eventually reset(groups..)
boolean getPreferenceBoolean_mainModule(int preferenceID)
called to set a preference (which will be an identifier and a string, which can be converted to a num...
void togglePreferenceBoolean_mainModule(int preferenceID)
toggles a preference boolean
void resetPreference_mainModule(int preferenceID)
called to reset to blank a preference (which will be an identifier and a string, which can be convert...
void storePreference_mainModule(int preferenceID, String preferenceValue)
called to append to a a preference (which will be an identifier and a string, which can be converted ...
void initAppendingPreference_mainModule(int preferenceID)
called to init the preference. This won't save anything until storePreference called
char * getPreferenceATOMKind_MainModule()
new 1.4.24 setting ATOM kind (eg. M5AtomSocket, M5AtomScanner)
void savePreferenceFloat_mainModule(int preferenceID, float val)
called to set a preference (which will be an identifier and a string, which can be converted to a num...
void savePreferenceIntFromString_mainModule(int preferenceID, char *val)
sets an int, but only if a valid integer, and no signs
void setOnBootPreferences_mainModule()
set some defaults on boot - that override EPROM this can be called on the HOME screen to set back to ...
void initSensorStringsFromEPROM_mainModule()
char * getPairedDeviceOrAddress_mainModule()
returns if the paired device is not NONE .. returns address or device
char * getPairedDevice_mainModule()
returns if the paired device is not NONE
boolean topicInIncludeGroup(char *topic)
int getM5ATOMKind_MainModule()
new 1.4.24 setting ATOM kind (eg. ATOM_KIND_M5_SCANNER, ATOM_KIND_M5_SOCKET)
int getPreferenceInt_mainModule(int preferenceID)
called to get a preference (which will be an identifier and a string, which can be converted to a num...
char * getPreference_mainModule(int preferenceID)
boolean isValidPairedDevice_mainModule()
returns if the paired device is not NONE
SensorStruct * getSensor_mainModule(char *sensorName)
return the sensor specified or null
void setIncludeGroups(char *groups)
8.2.24 set the include group (and cache it), called from MQTT
char * getPreferenceString_mainModule(int preferenceID)
returns the preference but in it's own string buffer. As long as you use it before calling getPrefere...
void printPreferenceValues_mainModule()
print the preferences to SerialDebug
void initPreferencesMainModule()
initialize the _preferencesMainLookup with EPROM lookup names
void savePreference_mainModule(int preferenceID, String preferenceValue)
called to set a preference (which will be an identifier and a string, which can be converted to a num...
struct sensorStruct SensorStruct
char * getPairedDeviceAddress_mainModule()
returns if the paired device is not NONE
SensorClassType * sensorClassType
and the pointer to matching SensorClassType
SensorStruct * sensors
array of sensorStruct