mirror of https://github.com/arendst/Tasmota.git
Merge pull request #13952 from barbudor/ble_miop6_comply_fulltopic
Make mi32option6 compliant with full topic
This commit is contained in:
commit
8276d9fe15
|
@ -2741,9 +2741,8 @@ void MI32ShowOneMISensor(){
|
||||||
kMI32DeviceType[p->type-1],
|
kMI32DeviceType[p->type-1],
|
||||||
p->MAC[3], p->MAC[4], p->MAC[5]);
|
p->MAC[3], p->MAC[4], p->MAC[5]);
|
||||||
}
|
}
|
||||||
char SensorTopic[60];
|
char SensorTopic[TOPSZ];
|
||||||
sprintf(SensorTopic, "tele/tasmota_ble/%s",
|
GetTopic_P(SensorTopic, TELE, (char*)"tasmota_ble", id);
|
||||||
id);
|
|
||||||
|
|
||||||
MqttPublish(SensorTopic, Settings->flag.mqtt_sensor_retain);
|
MqttPublish(SensorTopic, Settings->flag.mqtt_sensor_retain);
|
||||||
//AddLog(LOG_LEVEL_DEBUG,PSTR("M32: %s: show some %d %s"),D_CMND_MI32, MI32.mqttCurrentSlot, ResponseData());
|
//AddLog(LOG_LEVEL_DEBUG,PSTR("M32: %s: show some %d %s"),D_CMND_MI32, MI32.mqttCurrentSlot, ResponseData());
|
||||||
|
@ -2868,10 +2867,8 @@ void MI32DiscoveryOneMISensor(){
|
||||||
p->MAC[3], p->MAC[4], p->MAC[5]);
|
p->MAC[3], p->MAC[4], p->MAC[5]);
|
||||||
}
|
}
|
||||||
|
|
||||||
char SensorTopic[60];
|
char SensorTopic[TOPSZ];
|
||||||
sprintf(SensorTopic, "tele/tasmota_ble/%s",
|
GetTopic_P(SensorTopic, TELE, (char*)"tasmota_ble", id);
|
||||||
id);
|
|
||||||
|
|
||||||
|
|
||||||
//int i = p->nextDiscoveryData*3;
|
//int i = p->nextDiscoveryData*3;
|
||||||
for (int i = 0; i < datacount*3; i += 3){
|
for (int i = 0; i < datacount*3; i += 3){
|
||||||
|
@ -3063,7 +3060,7 @@ void MI32ShowTriggeredSensors(){
|
||||||
#endif //USE_HOME_ASSISTANT
|
#endif //USE_HOME_ASSISTANT
|
||||||
MI32.option.MQTTType == 1
|
MI32.option.MQTTType == 1
|
||||||
){
|
){
|
||||||
char SensorTopic[60];
|
char SensorTopic[TOPSZ];
|
||||||
char idstr[32];
|
char idstr[32];
|
||||||
const char *alias = BLE_ESP32::getAlias(p->MAC);
|
const char *alias = BLE_ESP32::getAlias(p->MAC);
|
||||||
const char *id = idstr;
|
const char *id = idstr;
|
||||||
|
@ -3074,7 +3071,7 @@ void MI32ShowTriggeredSensors(){
|
||||||
kMI32DeviceType[p->type-1],
|
kMI32DeviceType[p->type-1],
|
||||||
p->MAC[3], p->MAC[4], p->MAC[5]);
|
p->MAC[3], p->MAC[4], p->MAC[5]);
|
||||||
}
|
}
|
||||||
snprintf_P(SensorTopic, sizeof(SensorTopic), PSTR("tele/tasmota_ble/%s"), id);
|
GetTopic_P(SensorTopic, TELE, (char*)"tasmota_ble", id);
|
||||||
MqttPublish(SensorTopic, Settings->flag.mqtt_sensor_retain);
|
MqttPublish(SensorTopic, Settings->flag.mqtt_sensor_retain);
|
||||||
AddLog(LOG_LEVEL_DEBUG, PSTR("M32: triggered %d %s"), sensor, ResponseData());
|
AddLog(LOG_LEVEL_DEBUG, PSTR("M32: triggered %d %s"), sensor, ResponseData());
|
||||||
XdrvRulesProcess(0);
|
XdrvRulesProcess(0);
|
||||||
|
|
Loading…
Reference in New Issue