Skip to content

Commit 6a82e77

Browse files
committed
🚧 WIP, analogio - publish out
1 parent e5d3199 commit 6a82e77

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/analogIO/controller.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,15 @@ void AnalogIOController::update() {
151151
if (pin.read_mode == wippersnapper_sensor_SensorType_SENSOR_TYPE_RAW) {
152152
// Since we already read the raw value, encode and publish it to the
153153
// broker
154-
// TODO
154+
EncodePublishPinValue(pin.name, value);
155155
} else if (pin.read_mode ==
156156
wippersnapper_sensor_SensorType_SENSOR_TYPE_VOLTAGE) {
157157
// Convert the raw value into voltage
158158
float pin_value = _analogio_hardware->CalculatePinVoltage(value);
159159
// Encode and publish the voltage value to the broker
160+
EncodePublishPinVoltage(pin.name, pin_value);
161+
} else {
162+
WS_DEBUG_PRINTLN("ERROR: Invalid read mode for analog pin!");
160163
}
161164
}
162165
}

0 commit comments

Comments
 (0)