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

[Z2M] Change topic for permit join #1534

Merged
merged 3 commits into from
May 23, 2022
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
2 changes: 1 addition & 1 deletion server/services/zigbee2mqtt/lib/setPermitJoin.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const { EVENTS, WEBSOCKET_MESSAGE_TYPES } = require('../../../utils/constants');
async function setPermitJoin() {
this.z2mPermitJoin = !this.z2mPermitJoin;
// Send message to Zigbee2mqtt topics
this.mqttClient.publish(`zigbee2mqtt/bridge/config/permit_join`, this.z2mPermitJoin.toString());
this.mqttClient.publish(`zigbee2mqtt/bridge/request/permit_join`, this.z2mPermitJoin.toString());
logger.log('Set Permit_join to', this.z2mPermitJoin);

this.gladys.event.emit(EVENTS.WEBSOCKET.SEND_ALL, {
Expand Down
2 changes: 1 addition & 1 deletion server/test/services/zigbee2mqtt/lib/setPermitJoin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('zigbee2mqtt setPermitJoin', () => {
// EXECUTE
await zigbee2MqttService.device.setPermitJoin();
// ASSERT
assert.calledWith(mqtt.publish, 'zigbee2mqtt/bridge/config/permit_join', 'true');
assert.calledWith(mqtt.publish, 'zigbee2mqtt/bridge/request/permit_join', 'true');
assert.calledWith(gladys.event.emit, EVENTS.WEBSOCKET.SEND_ALL, {
type: WEBSOCKET_MESSAGE_TYPES.ZIGBEE2MQTT.PERMIT_JOIN,
payload: true,
Expand Down