mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-11-02 10:51:57 +00:00
fix(bot): !temp and {temp} fall back to the chip's temperature
Same gap as the screens had: the bot reply, a typed message's {temp} and
the placeholder lists read only the sensors, so a board without one (the
L1) answered !temp with n/a while its telemetry carried a temperature.
The fallback moves to LocalSensors.h, shared by the screens, expandMsg()
and sensorPlaceholders(); the latter now takes the chip's temperature.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -102,7 +102,7 @@ static void formatDashVal(uint8_t field, char* val, int val_len, uint16_t batt_m
|
||||
if (telemetry::isSensor(field)) {
|
||||
if (!lpp) {
|
||||
static CayenneLPP s_lpp(200); s_lpp.reset();
|
||||
{ CardKBBusLock bus_lock; telemetry::querySensors(sensors, board.getMCUTemperature(), s_lpp); }
|
||||
{ CardKBBusLock bus_lock; queryLocalSensors(sensors, board.getMCUTemperature(), s_lpp); }
|
||||
lpp = &s_lpp;
|
||||
}
|
||||
in.lpp = lpp->getBuffer();
|
||||
@@ -652,7 +652,7 @@ class HomeScreen : public UIScreen {
|
||||
sensors_lpp.reset();
|
||||
sensors_nb = 0;
|
||||
sensors_lpp.addVoltage(TELEM_CHANNEL_SELF, (float)board.getBattMilliVolts() / 1000.0f);
|
||||
{ CardKBBusLock bus_lock; telemetry::querySensors(sensors, board.getMCUTemperature(), sensors_lpp); }
|
||||
{ CardKBBusLock bus_lock; queryLocalSensors(sensors, board.getMCUTemperature(), sensors_lpp); }
|
||||
LPPReader reader (sensors_lpp.getBuffer(), sensors_lpp.getSize());
|
||||
uint8_t channel, type;
|
||||
while(reader.readHeader(channel, type)) {
|
||||
|
||||
Reference in New Issue
Block a user