mirror of
https://github.com/Laxilef/OTGateway.git
synced 2025-12-12 11:14:28 +05:00
added external pump control
This commit is contained in:
21
lib/WiFiManagerParameters/UnsignedShortParameter.h
Normal file
21
lib/WiFiManagerParameters/UnsignedShortParameter.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
#include <WiFiManager.h>
|
||||
|
||||
class UnsignedShortParameter : public WiFiManagerParameter {
|
||||
public:
|
||||
UnsignedShortParameter(const char* id, const char* label, unsigned short value, const uint8_t length = 10) : WiFiManagerParameter("") {
|
||||
init(id, label, String(value).c_str(), length, "", WFM_LABEL_DEFAULT);
|
||||
}
|
||||
|
||||
unsigned short getValue() {
|
||||
return (unsigned short) atoi(WiFiManagerParameter::getValue());
|
||||
}
|
||||
|
||||
void setValue(unsigned short value, int length) {
|
||||
WiFiManagerParameter::setValue(String(value).c_str(), length);
|
||||
}
|
||||
|
||||
void setValue(unsigned short value) {
|
||||
setValue(value, getValueLength());
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user