Skip to content

Commit

Permalink
MQTT Hass: Change parameter order for publishDtuBinarySensor
Browse files Browse the repository at this point in the history
  • Loading branch information
tbnobody committed Sep 24, 2024
1 parent 57c5b8c commit a7100f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/MqttHandleHass.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class MqttHandleHassClass {
void loop();
static void publish(const String& subtopic, const String& payload);
static void publishDtuSensor(const String& name, const String& subTopic, const String& unit_of_measure, const String& icon, const String& device_class, const String& category);
static void publishDtuBinarySensor(const String& name, const String& device_class, const String& category, const String& payload_on, const String& payload_off, const String& subTopic = "");
static void publishDtuBinarySensor(const String& name, const String& subTopic, const String& payload_on, const String& payload_off, const String& device_class, const String& category);
static void publishInverterField(std::shared_ptr<InverterAbstract> inv, const ChannelType_t type, const ChannelNum_t channel, const byteAssign_fieldDeviceClass_t fieldType, const bool clear = false);
static void publishInverterButton(std::shared_ptr<InverterAbstract> inv, const String& name, const String& icon, const String& category, const String& deviceClass, const String& subTopic, const String& payload);
static void publishInverterNumber(std::shared_ptr<InverterAbstract> inv, const String& name, const String& icon, const String& category, const String& commandTopic, const String& stateTopic, const String& unitOfMeasure, const int16_t min = 1, const int16_t max = 100, float step = 1.0);
Expand Down
4 changes: 2 additions & 2 deletions src/MqttHandleHass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void MqttHandleHassClass::publishConfig()
publishDtuSensor("Largest Free Heap Block", "heap/maxalloc", "Bytes", "mdi:memory", "", "diagnostic");
publishDtuSensor("Lifetime Minimum Free Heap", "heap/minfree", "Bytes", "mdi:memory", "", "diagnostic");

publishDtuBinarySensor("Status", "connectivity", "diagnostic", config.Mqtt.Lwt.Value_Online, config.Mqtt.Lwt.Value_Offline, config.Mqtt.Lwt.Topic);
publishDtuBinarySensor("Status", config.Mqtt.Lwt.Topic, config.Mqtt.Lwt.Value_Online, config.Mqtt.Lwt.Value_Offline, "connectivity", "diagnostic");

yield();

Expand Down Expand Up @@ -402,7 +402,7 @@ void MqttHandleHassClass::publishDtuSensor(const String& name, const String& sub
publish(configTopic, buffer);
}

void MqttHandleHassClass::publishDtuBinarySensor(const String& name, const String& device_class, const String& category, const String& payload_on, const String& payload_off, const String& subTopic)
void MqttHandleHassClass::publishDtuBinarySensor(const String& name, const String& subTopic, const String& payload_on, const String& payload_off, const String& device_class, const String& category)
{
String id = name;
id.toLowerCase();
Expand Down

0 comments on commit a7100f2

Please sign in to comment.