mirror of
https://github.com/esphome/esphome.git
synced 2024-11-10 09:17:46 +01:00
include payload_open when a lock supports OPEN (#5809)
This commit is contained in:
parent
47d42afda3
commit
1c4b06700f
1 changed files with 2 additions and 0 deletions
|
@ -40,6 +40,8 @@ const EntityBase *MQTTLockComponent::get_entity() const { return this->lock_; }
|
||||||
void MQTTLockComponent::send_discovery(JsonObject root, mqtt::SendDiscoveryConfig &config) {
|
void MQTTLockComponent::send_discovery(JsonObject root, mqtt::SendDiscoveryConfig &config) {
|
||||||
if (this->lock_->traits.get_assumed_state())
|
if (this->lock_->traits.get_assumed_state())
|
||||||
root[MQTT_OPTIMISTIC] = true;
|
root[MQTT_OPTIMISTIC] = true;
|
||||||
|
if (this->lock_->traits.get_supports_open())
|
||||||
|
root[MQTT_PAYLOAD_OPEN] = "OPEN";
|
||||||
}
|
}
|
||||||
bool MQTTLockComponent::send_initial_state() { return this->publish_state(); }
|
bool MQTTLockComponent::send_initial_state() { return this->publish_state(); }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue