mirror of
https://github.com/xoseperez/espurna.git
synced 2026-03-14 20:27:09 +01:00
Fix reference to sensor slot method
This commit is contained in:
@@ -37,6 +37,11 @@ class AnalogSensor : public BaseSensor {
|
||||
return String("ANALOG @ GPIO0");
|
||||
}
|
||||
|
||||
// Descriptive name of the slot # index
|
||||
String slot(unsigned char index) {
|
||||
return description();
|
||||
};
|
||||
|
||||
// Type for slot # index
|
||||
unsigned char type(unsigned char index) {
|
||||
_error = SENSOR_ERROR_OK;
|
||||
|
||||
@@ -62,7 +62,7 @@ class BaseSensor {
|
||||
static void manifest(JsonArray& root) {};
|
||||
|
||||
// Descriptive name of the slot # index
|
||||
String slot(unsigned char index) { return description(); }
|
||||
virtual String slot(unsigned char index) {};
|
||||
|
||||
// Sensor ID
|
||||
unsigned char getID() { return _sensor_id; };
|
||||
|
||||
@@ -90,6 +90,11 @@ class DHTSensor : public BaseSensor {
|
||||
return String(buffer);
|
||||
}
|
||||
|
||||
// Descriptive name of the slot # index
|
||||
String slot(unsigned char index) {
|
||||
return description();
|
||||
};
|
||||
|
||||
// Type for slot # index
|
||||
unsigned char type(unsigned char index) {
|
||||
_error = SENSOR_ERROR_OK;
|
||||
|
||||
@@ -67,6 +67,11 @@ class DigitalSensor : public BaseSensor {
|
||||
return String(buffer);
|
||||
}
|
||||
|
||||
// Descriptive name of the slot # index
|
||||
String slot(unsigned char index) {
|
||||
return description();
|
||||
};
|
||||
|
||||
// Type for slot # index
|
||||
unsigned char type(unsigned char index) {
|
||||
_error = SENSOR_ERROR_OK;
|
||||
|
||||
@@ -82,6 +82,11 @@ class ECH1560Sensor : public BaseSensor {
|
||||
return String(buffer);
|
||||
}
|
||||
|
||||
// Descriptive name of the slot # index
|
||||
String slot(unsigned char index) {
|
||||
return description();
|
||||
};
|
||||
|
||||
// Type for slot # index
|
||||
unsigned char type(unsigned char index) {
|
||||
_error = SENSOR_ERROR_OK;
|
||||
|
||||
@@ -81,6 +81,11 @@ class EventSensor : public BaseSensor {
|
||||
return String(buffer);
|
||||
}
|
||||
|
||||
// Descriptive name of the slot # index
|
||||
String slot(unsigned char index) {
|
||||
return description();
|
||||
};
|
||||
|
||||
// Type for slot # index
|
||||
unsigned char type(unsigned char index) {
|
||||
_error = SENSOR_ERROR_OK;
|
||||
|
||||
@@ -162,6 +162,11 @@ class HLW8012Sensor : public BaseSensor {
|
||||
return String(buffer);
|
||||
}
|
||||
|
||||
// Descriptive name of the slot # index
|
||||
String slot(unsigned char index) {
|
||||
return description();
|
||||
};
|
||||
|
||||
// Type for slot # index
|
||||
unsigned char type(unsigned char index) {
|
||||
_error = SENSOR_ERROR_OK;
|
||||
|
||||
@@ -23,6 +23,11 @@ class I2CSensor : public BaseSensor {
|
||||
return _address;
|
||||
}
|
||||
|
||||
// Descriptive name of the slot # index
|
||||
String slot(unsigned char index) {
|
||||
return description();
|
||||
};
|
||||
|
||||
protected:
|
||||
|
||||
// Specific for I2C sensors
|
||||
|
||||
@@ -89,6 +89,11 @@ class MHZ19Sensor : public BaseSensor {
|
||||
return String(buffer);
|
||||
}
|
||||
|
||||
// Descriptive name of the slot # index
|
||||
String slot(unsigned char index) {
|
||||
return description();
|
||||
};
|
||||
|
||||
// Type for slot # index
|
||||
unsigned char type(unsigned char index) {
|
||||
_error = SENSOR_ERROR_OK;
|
||||
|
||||
@@ -85,6 +85,11 @@ class SI7021Sensor : public I2CSensor {
|
||||
return String(buffer);
|
||||
}
|
||||
|
||||
// Descriptive name of the slot # index
|
||||
String slot(unsigned char index) {
|
||||
return description();
|
||||
};
|
||||
|
||||
// Type for slot # index
|
||||
unsigned char type(unsigned char index) {
|
||||
if (index < _count) {
|
||||
|
||||
@@ -77,6 +77,11 @@ class V9261FSensor : public BaseSensor {
|
||||
return String(buffer);
|
||||
}
|
||||
|
||||
// Descriptive name of the slot # index
|
||||
String slot(unsigned char index) {
|
||||
return description();
|
||||
};
|
||||
|
||||
// Loop-like method, call it in your main loop
|
||||
void tick() {
|
||||
_read();
|
||||
|
||||
Reference in New Issue
Block a user