Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mqtt.homie] Add DateTime channel type to comply with MQTT Homie convention 3.x #11894

Merged
merged 1 commit into from
Jan 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.openhab.binding.mqtt.generic.mapping.AbstractMqttAttributeClass.AttributeChanged;
import org.openhab.binding.mqtt.generic.mapping.ColorMode;
import org.openhab.binding.mqtt.generic.values.ColorValue;
import org.openhab.binding.mqtt.generic.values.DateTimeValue;
import org.openhab.binding.mqtt.generic.values.NumberValue;
import org.openhab.binding.mqtt.generic.values.OnOffValue;
import org.openhab.binding.mqtt.generic.values.PercentageValue;
Expand Down Expand Up @@ -218,6 +219,9 @@ public void createChannelFromAttribute() {
value = new NumberValue(min, max, step, attributes.unit);
}
break;
case datetime_:
value = new DateTimeValue();
break;
case string_:
case unknown:
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public enum DataTypeEnum {
boolean_,
string_,
enum_,
color_
color_,
datetime_
}

public String name = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
<option value="string_">String</option>
<option value="enum_">Enumeration</option>
<option value="color_">Colour</option>
<option value="datetime_">DateTime</option>
</options>
</parameter>
</config-description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ channel-type.config.mqtt.homie-channel.datatype.option.boolean_ = Boolean
channel-type.config.mqtt.homie-channel.datatype.option.string_ = String
channel-type.config.mqtt.homie-channel.datatype.option.enum_ = Enumeration
channel-type.config.mqtt.homie-channel.datatype.option.color_ = Colour
channel-type.config.mqtt.homie-channel.datatype.option.datetime_ = DateTime
channel-type.config.mqtt.homie-channel.format.label = Format
channel-type.config.mqtt.homie-channel.format.description = The output format.
channel-type.config.mqtt.homie-channel.name.label = Name
Expand Down