Skip to content

Commit e111d64

Browse files
committed
Fix: Default to empty sensor description
1 parent f642ec8 commit e111d64

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

libraries/MySensors/MySensor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ void MySensor::sendBatteryLevel(uint8_t value, bool enableAck) {
484484
}
485485

486486
void MySensor::present(uint8_t childSensorId, uint8_t sensorType, bool enableAck, const char*description) {
487-
sendRoute(build(msg, nc.nodeId, GATEWAY_ADDRESS, childSensorId, C_PRESENTATION, sensorType, enableAck).set(description));
487+
sendRoute(build(msg, nc.nodeId, GATEWAY_ADDRESS, childSensorId, C_PRESENTATION, sensorType, enableAck).set(childSensorId==NODE_SENSOR_ID?LIBRARY_VERSION:description));
488488
}
489489

490490
void MySensor::sendSketchInfo(const char *name, const char *version, bool enableAck) {

libraries/MySensors/MySensor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ class MySensor
180180
* @param ack Set this to true if you want destination node to send ack back to this node. Default is not to request any ack.
181181
* @param description A textual description of the sensor. Defaults to library version.
182182
*/
183-
void present(uint8_t sensorId, uint8_t sensorType, bool ack=false, const char *description=LIBRARY_VERSION);
183+
void present(uint8_t sensorId, uint8_t sensorType, bool ack=false, const char *description="");
184184

185185
/**
186186
* Sends sketch meta information to the gateway. Not mandatory but a nice thing to do.

0 commit comments

Comments
 (0)