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

Prevent Home Assistant warnings on Ring Event #306

Merged
merged 1 commit into from
Feb 24, 2024
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
1 change: 1 addition & 0 deletions MqttTopics.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#define mqtt_topic_query_lockstate_command_result "/lock/query/lockstateCommandResult"
#define mqtt_topic_lock_binary_state "/lock/binaryState"
#define mqtt_topic_lock_continuous_mode "/lock/continuousMode"
#define mqtt_topic_lock_ring "/lock/ring"
#define mqtt_topic_lock_trigger "/lock/trigger"
#define mqtt_topic_lock_last_lock_action "/lock/lastLockAction"
#define mqtt_topic_lock_log "/lock/log"
Expand Down
2 changes: 1 addition & 1 deletion Network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,7 @@ void Network::publishHASSConfigRingDetect(char *deviceType, const char *baseTopi
{"pl_off", "locked"}});

DynamicJsonDocument json(_bufferSize);
json = createHassJson(uidString, "_ring_event", "Ring", name, baseTopic, String("~") + mqtt_topic_lock_state, deviceType, "doorbell", "", "", "", {{"value_template", "{ \"event_type\": \"{{ value }}\" }"}});
json = createHassJson(uidString, "_ring_event", "Ring", name, baseTopic, String("~") + mqtt_topic_lock_ring, deviceType, "doorbell", "", "", "", {{"value_template", "{ \"event_type\": \"{{ value }}\" }, \"duration\": 2"}});
json["event_types"][0] = "ring";
serializeJson(json, _buffer, _bufferSize);
String path = createHassTopicPath("event", "ring", uidString);
Expand Down
1 change: 1 addition & 0 deletions NetworkOpener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ void NetworkOpener::publishKeyTurnerState(const NukiOpener::OpenerState& keyTurn
void NetworkOpener::publishRing()
{
publishString(mqtt_topic_lock_state, "ring");
publishString(mqtt_topic_lock_ring, "ring");
_resetLockStateTs = millis() + 2000;
}

Expand Down
Loading