Skip to content

Commit

Permalink
[mqtt.homeassistant] Fix MQTT Vacuum serialization names (openhab#11550)
Browse files Browse the repository at this point in the history
While integrating the review comments, I did not remember that some
variable names are written as they are because they result from some
deserialization.

This small PR fixes this.

Signed-off-by: Stefan Triller <[email protected]>
  • Loading branch information
t2000 authored Nov 10, 2021
1 parent 0ec64b6 commit 90ebb48
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import org.openhab.binding.mqtt.generic.values.TextValue;
import org.openhab.binding.mqtt.homeassistant.internal.config.dto.AbstractChannelConfiguration;

import com.google.gson.annotations.SerializedName;

/**
* A MQTT vacuum, following the https://www.home-assistant.io/components/vacuum.mqtt/ specification.
*
Expand Down Expand Up @@ -69,16 +71,24 @@ static class ChannelConfiguration extends AbstractChannelConfiguration {
super("MQTT Vacuum");
}

@SerializedName("command_topic")
protected @Nullable String commandTopic;
@SerializedName("state_topic")
protected String stateTopic = "";
@SerializedName("send_command_topic")
protected @Nullable String sendCommandTopic; // for custom_command

// [start, pause, stop, return_home, battery, status, locate, clean_spot, fan_speed, send_command]
@SerializedName("supported_features")
protected String[] supportedFeatures = new String[] {};
@SerializedName("set_fan_speed_topic")
protected @Nullable String setFanSpeedTopic;
@SerializedName("fan_speed_list")
protected String[] fanSpeedList = new String[] {};

@SerializedName("json_attributes_topic")
protected @Nullable String jsonAttributesTopic;
@SerializedName("json_attributes_template")
protected @Nullable String jsonAttributesTemplate;
}

Expand Down

0 comments on commit 90ebb48

Please sign in to comment.