Skip to content

Commit b6a845a

Browse files
committed
Fix for doorbell events
1 parent 40494f8 commit b6a845a

File tree

4 files changed

+28
-11
lines changed

4 files changed

+28
-11
lines changed

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,17 @@
22

33
All notable changes to this project will be documented in this file. This project uses [Semantic Versioning](https://semver.org/).
44

5+
## 0.8.2 (2024-12-27)
6+
7+
## [Version 0.8.2](https://github.com/northernman54/homebridge-alexa/compare/v0.8.1...v0.8.2)
8+
9+
#### Bug Fix
10+
11+
- Doorbell events not being received
12+
513
## 0.8.1 (2024-12-24)
614

7-
## [Version 0.8.0](https://github.com/northernman54/homebridge-alexa/compare/v0.8.0...v0.8.1)
15+
## [Version 0.8.1](https://github.com/northernman54/homebridge-alexa/compare/v0.8.0...v0.8.1)
816

917
#### Bug Fix
1018

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "homebridge-alexa",
3-
"version": "0.8.1",
3+
"version": "0.8.2",
44
"description": "Control your Homebridge devices with Amazon Alexa.",
55
"main": "src/plugin.js",
66
"scripts": {

src/lib/alexaLocal.js

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,16 +161,25 @@ function handleError(err, options) {
161161
}
162162

163163
function alexaEvent(message) {
164-
publishMessage(`event/${username}/1`, message);
164+
var topic = "event/" + username + "/1";
165+
var publish = function (callback) {
166+
debug("Sending message", topic, JSON.stringify(message));
167+
connection.client.publish(topic, JSON.stringify(message), {
168+
retain: false
169+
}, callback);
170+
};
171+
limiter.submit(publish);
165172
}
166173

167174
function alexaPriorityEvent(message) {
168-
limiter.submit({ priority: 4 }, publishMessage, `event/${username}/1`, message);
169-
}
170-
171-
function publishMessage(topic, message, callback) {
172-
debug("Publishing message", topic, JSON.stringify(message));
173-
connection.client.publish(topic, JSON.stringify(message), { retain: false }, callback);
175+
var topic = "event/" + username + "/1";
176+
var publish = function (callback) {
177+
debug("Sending priority message", topic, JSON.stringify(message));
178+
connection.client.publish(topic, JSON.stringify(message), {
179+
retain: false
180+
}, callback);
181+
};
182+
limiter.submit({ priority: 4 }, publish);
174183
}
175184

176185
function createAlexaErrorResponse(message) {

0 commit comments

Comments
 (0)