Skip to content

Commit

Permalink
Fix for doorbell events
Browse files Browse the repository at this point in the history
  • Loading branch information
NorthernMan54 committed Dec 27, 2024
1 parent 40494f8 commit b6a845a
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 11 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@

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

## 0.8.2 (2024-12-27)

## [Version 0.8.2](https://github.com/northernman54/homebridge-alexa/compare/v0.8.1...v0.8.2)

#### Bug Fix

- Doorbell events not being received

## 0.8.1 (2024-12-24)

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

#### Bug Fix

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "homebridge-alexa",
"version": "0.8.1",
"version": "0.8.2",
"description": "Control your Homebridge devices with Amazon Alexa.",
"main": "src/plugin.js",
"scripts": {
Expand Down
23 changes: 16 additions & 7 deletions src/lib/alexaLocal.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,16 +161,25 @@ function handleError(err, options) {
}

function alexaEvent(message) {
publishMessage(`event/${username}/1`, message);
var topic = "event/" + username + "/1";
var publish = function (callback) {
debug("Sending message", topic, JSON.stringify(message));
connection.client.publish(topic, JSON.stringify(message), {
retain: false
}, callback);
};
limiter.submit(publish);
}

function alexaPriorityEvent(message) {
limiter.submit({ priority: 4 }, publishMessage, `event/${username}/1`, message);
}

function publishMessage(topic, message, callback) {
debug("Publishing message", topic, JSON.stringify(message));
connection.client.publish(topic, JSON.stringify(message), { retain: false }, callback);
var topic = "event/" + username + "/1";
var publish = function (callback) {
debug("Sending priority message", topic, JSON.stringify(message));
connection.client.publish(topic, JSON.stringify(message), {
retain: false
}, callback);
};
limiter.submit({ priority: 4 }, publish);
}

function createAlexaErrorResponse(message) {
Expand Down

0 comments on commit b6a845a

Please sign in to comment.