Browse Source

Fix reference to sensor slot method

i18n
Xose Pérez 6 years ago
parent
commit
c38911beae
11 changed files with 51 additions and 1 deletions
  1. +5
    -0
      code/espurna/sensors/AnalogSensor.h
  2. +1
    -1
      code/espurna/sensors/BaseSensor.h
  3. +5
    -0
      code/espurna/sensors/DHTSensor.h
  4. +5
    -0
      code/espurna/sensors/DigitalSensor.h
  5. +5
    -0
      code/espurna/sensors/ECH1560Sensor.h
  6. +5
    -0
      code/espurna/sensors/EventSensor.h
  7. +5
    -0
      code/espurna/sensors/HLW8012Sensor.h
  8. +5
    -0
      code/espurna/sensors/I2CSensor.h
  9. +5
    -0
      code/espurna/sensors/MHZ19Sensor.h
  10. +5
    -0
      code/espurna/sensors/SI7021Sensor.h
  11. +5
    -0
      code/espurna/sensors/V9261FSensor.h

+ 5
- 0
code/espurna/sensors/AnalogSensor.h View File

@ -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;


+ 1
- 1
code/espurna/sensors/BaseSensor.h View File

@ -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; };


+ 5
- 0
code/espurna/sensors/DHTSensor.h View File

@ -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;


+ 5
- 0
code/espurna/sensors/DigitalSensor.h View File

@ -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;


+ 5
- 0
code/espurna/sensors/ECH1560Sensor.h View File

@ -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;


+ 5
- 0
code/espurna/sensors/EventSensor.h View File

@ -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;


+ 5
- 0
code/espurna/sensors/HLW8012Sensor.h View File

@ -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;


+ 5
- 0
code/espurna/sensors/I2CSensor.h View File

@ -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


+ 5
- 0
code/espurna/sensors/MHZ19Sensor.h View File

@ -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;


+ 5
- 0
code/espurna/sensors/SI7021Sensor.h View File

@ -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) {


+ 5
- 0
code/espurna/sensors/V9261FSensor.h View File

@ -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();


Loading…
Cancel
Save