Skip to content

Commit

Permalink
remove defaults for HA Discovery Sensor Object
Browse files Browse the repository at this point in the history
  • Loading branch information
LoQue90 committed Sep 25, 2024
1 parent 2d9b152 commit af301a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/mqtt.h
Original file line number Diff line number Diff line change
Expand Up @@ -401,10 +401,10 @@ DiscoveryObject GenerateButtonDevice(String name, String displayName, String pay
*
* @param name The name of the sensor (used in MQTT topics)
* @param displayName The display name of the sensor (shown in Home Assistant)
* @param unit_of_measurement The unit of measurement for the sensor data (default: "°C")
* @param unit_of_measurement The unit of measurement for the sensor data
* @return A `DiscoveryObject` containing the sensor device configuration
*/
DiscoveryObject GenerateSensorDevice(String name, String displayName, String unit_of_measurement = "°C", String device_class = "temperature") {
DiscoveryObject GenerateSensorDevice(String name, String displayName, String unit_of_measurement, String device_class) {
String mqtt_topic = String(mqtt_topic_prefix) + String(hostname);
DiscoveryObject sensor_device;
String unique_id = "clevercoffee-" + String(hostname);
Expand Down Expand Up @@ -517,7 +517,7 @@ int sendHASSIODiscoveryMsg() {
DiscoveryObject brewtime = GenerateNumberDevice("brewtime", "Brew time", BREW_TIME_MIN, BREW_TIME_MAX, 0.1, "s");

// Sensor Devices
DiscoveryObject actual_temperature = GenerateSensorDevice("temperature", "Boiler Temperature");
DiscoveryObject actual_temperature = GenerateSensorDevice("temperature", "Boiler Temperature", "°C", "temperature");
DiscoveryObject heaterPower = GenerateSensorDevice("heaterPower", "Heater Power", "%", "power_factor");
DiscoveryObject machineStateDevice = GenerateSensorDevice("machineState", "Machine State", "", "enum");
DiscoveryObject currentWeight = GenerateSensorDevice("currentWeight", "Weight", "g", "weight");
Expand Down

0 comments on commit af301a5

Please sign in to comment.