Add DateTime channel type to comply with mqtt homie convention 3.x (#11894)
Signed-off-by: Lukas Agethen <lukas83@gmx.de>
This commit is contained in:
parent
348a1ce422
commit
1280a0e11b
@ -30,6 +30,7 @@ import org.openhab.binding.mqtt.generic.mapping.AbstractMqttAttributeClass;
|
|||||||
import org.openhab.binding.mqtt.generic.mapping.AbstractMqttAttributeClass.AttributeChanged;
|
import org.openhab.binding.mqtt.generic.mapping.AbstractMqttAttributeClass.AttributeChanged;
|
||||||
import org.openhab.binding.mqtt.generic.mapping.ColorMode;
|
import org.openhab.binding.mqtt.generic.mapping.ColorMode;
|
||||||
import org.openhab.binding.mqtt.generic.values.ColorValue;
|
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.NumberValue;
|
||||||
import org.openhab.binding.mqtt.generic.values.OnOffValue;
|
import org.openhab.binding.mqtt.generic.values.OnOffValue;
|
||||||
import org.openhab.binding.mqtt.generic.values.PercentageValue;
|
import org.openhab.binding.mqtt.generic.values.PercentageValue;
|
||||||
@ -218,6 +219,9 @@ public class Property implements AttributeChanged {
|
|||||||
value = new NumberValue(min, max, step, attributes.unit);
|
value = new NumberValue(min, max, step, attributes.unit);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case datetime_:
|
||||||
|
value = new DateTimeValue();
|
||||||
|
break;
|
||||||
case string_:
|
case string_:
|
||||||
case unknown:
|
case unknown:
|
||||||
default:
|
default:
|
||||||
|
|||||||
@ -36,7 +36,8 @@ public class PropertyAttributes extends AbstractMqttAttributeClass {
|
|||||||
boolean_,
|
boolean_,
|
||||||
string_,
|
string_,
|
||||||
enum_,
|
enum_,
|
||||||
color_
|
color_,
|
||||||
|
datetime_
|
||||||
}
|
}
|
||||||
|
|
||||||
public String name = "";
|
public String name = "";
|
||||||
|
|||||||
@ -42,6 +42,7 @@
|
|||||||
<option value="string_">String</option>
|
<option value="string_">String</option>
|
||||||
<option value="enum_">Enumeration</option>
|
<option value="enum_">Enumeration</option>
|
||||||
<option value="color_">Colour</option>
|
<option value="color_">Colour</option>
|
||||||
|
<option value="datetime_">DateTime</option>
|
||||||
</options>
|
</options>
|
||||||
</parameter>
|
</parameter>
|
||||||
</config-description>
|
</config-description>
|
||||||
|
|||||||
@ -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.string_ = String
|
||||||
channel-type.config.mqtt.homie-channel.datatype.option.enum_ = Enumeration
|
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.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.label = Format
|
||||||
channel-type.config.mqtt.homie-channel.format.description = The output format.
|
channel-type.config.mqtt.homie-channel.format.description = The output format.
|
||||||
channel-type.config.mqtt.homie-channel.name.label = Name
|
channel-type.config.mqtt.homie-channel.name.label = Name
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user