From 83e331323c19c70f25617fa6baf75e933cd9baf7 Mon Sep 17 00:00:00 2001 From: Rotzbua Date: Tue, 3 Oct 2023 10:54:13 +0200 Subject: [PATCH] fix: Correct typos (#19143) Credit to `codespell`. --- CONTRIBUTING.md | 4 ++-- lib/extension/availability.ts | 2 +- lib/extension/extension.ts | 2 +- lib/extension/homeassistant.ts | 2 +- lib/util/settings.schema.json | 4 ++-- test/availability.test.js | 8 ++++---- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 613a4a0c..29b9ae9a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,8 +1,8 @@ # Contributing to Zigbee2MQTT -Everybody is invited and welcome to contribute to Zigbee2MQTT. Zigbee2MQTT is writen in JavaScript and is based upon [zigbee-herdsman](https://github.com/koenkk/zigbee-herdsman) and [zigbee-herdsman-converters](https://github.com/koenkk/zigbee-herdsman-converters). Zigbee-herdsman-converters contains all device definition, zigbee-herdsman is responsible for handling all communication with the adapter. +Everybody is invited and welcome to contribute to Zigbee2MQTT. Zigbee2MQTT is written in JavaScript and is based upon [zigbee-herdsman](https://github.com/koenkk/zigbee-herdsman) and [zigbee-herdsman-converters](https://github.com/koenkk/zigbee-herdsman-converters). Zigbee-herdsman-converters contains all device definitions, zigbee-herdsman is responsible for handling all communication with the adapter. - Pull requests are always created against the [**dev**](https://github.com/Koenkk/zigbee2mqtt/tree/dev) branch. - Easiest way to start developing Zigbee2MQTT is by setting up a development environment (aka bare-metal installation). You can follow this [guide](https://www.zigbee2mqtt.io/guide/installation/01_linux.html) to do this. - You can run the tests locally by executing `npm test`. Zigbee2MQTT enforces 100% code coverage, in case you add new code check if your code is covered by running `npm run test-with-coverage`. The coverage report can be found under `coverage/lcov-report/index.html`. Linting is also enforced and can be run with `npm run eslint`. -- When you want to add support for a new devices no changes to Zigbee2MQTT have to be made, only to zigbee-herdsman-converters. You can find a guide for it [here](https://www.zigbee2mqtt.io/advanced/support-new-devices/01_support_new_devices.html). +- When you want to add support for a new device no changes to Zigbee2MQTT have to be made, only to zigbee-herdsman-converters. You can find a guide for it [here](https://www.zigbee2mqtt.io/advanced/support-new-devices/01_support_new_devices.html). diff --git a/lib/extension/availability.ts b/lib/extension/availability.ts index e711576d..54521be2 100644 --- a/lib/extension/availability.ts +++ b/lib/extension/availability.ts @@ -122,7 +122,7 @@ export default class Availability extends Extension { @bind private publishAvailabilityForAllEntities(): void { for (const entity of [...this.zigbee.devices(false), ...this.zigbee.groups()]) { if (utils.isAvailabilityEnabledForEntity(entity, settings.get())) { - // Publish initial availablility + // Publish initial availability this.publishAvailability(entity, true, false, true); if (entity.isDevice()) { diff --git a/lib/extension/extension.ts b/lib/extension/extension.ts index 30649867..efad18e6 100644 --- a/lib/extension/extension.ts +++ b/lib/extension/extension.ts @@ -9,7 +9,7 @@ abstract class Extension { protected addExtension: (extension: Extension) => Promise; /** - * Besides intializing variables, the constructor should do nothing! + * Besides initializing variables, the constructor should do nothing! * * @param {Zigbee} zigbee Zigbee controller * @param {MQTT} mqtt MQTT controller diff --git a/lib/extension/homeassistant.ts b/lib/extension/homeassistant.ts index 4b9b3035..e3d2d384 100644 --- a/lib/extension/homeassistant.ts +++ b/lib/extension/homeassistant.ts @@ -1103,7 +1103,7 @@ export default class HomeAssistant extends Extension { for (const expose of exposes.filter((e) => groupSupportedTypes.includes(e.type))) { let key = expose.type; if (['switch', 'lock', 'cover'].includes(expose.type) && expose.endpoint) { - // A device can have multiple of these types which have to discovered seperately. + // A device can have multiple of these types which have to discovered separately. // e.g. switch with property state and valve_detection. const state = expose.features.find((f) => f.name === 'state'); key += featurePropertyWithoutEndpoint(state); diff --git a/lib/util/settings.schema.json b/lib/util/settings.schema.json index d7d58fb2..e1cb7391 100644 --- a/lib/util/settings.schema.json +++ b/lib/util/settings.schema.json @@ -449,7 +449,7 @@ "type": "boolean", "title": "Legacy availability payload", "requiresRestart": true, - "description": "Payload to be used for device availabilty and bridge/state topics. true = text, false = JSON", + "description": "Payload to be used for device availability and bridge/state topics. true = text, false = JSON", "default": true }, "log_rotation": { @@ -912,7 +912,7 @@ "title": "Group off state", "default": "auto", "requiresRestart": true, - "description": "Control when to publish state OFF for a group. 'all_members_off': only publish state OFF when all group memebers are in state OFF, 'last_member_state': publish state OFF whenever one of its members changes to OFF" + "description": "Control when to publish state OFF for a group. 'all_members_off': only publish state OFF when all group members are in state OFF, 'last_member_state': publish state OFF whenever one of its members changes to OFF" }, "filtered_attributes": { "type": "array", diff --git a/test/availability.test.js b/test/availability.test.js index 80dc1918..c8fa6f95 100644 --- a/test/availability.test.js +++ b/test/availability.test.js @@ -58,7 +58,7 @@ describe('Availability', () => { jest.useRealTimers(); }) - it('Should publish availabilty on startup for device where it is enabled for', async () => { + it('Should publish availability on startup for device where it is enabled for', async () => { expect(MQTT.publish).toHaveBeenCalledWith('zigbee2mqtt/bulb_color/availability', 'online', {retain: true, qos: 1}, expect.any(Function)); expect(MQTT.publish).toHaveBeenCalledWith('zigbee2mqtt/remote/availability', @@ -236,7 +236,7 @@ describe('Availability', () => { expect(devices.bulb_color.ping).toHaveBeenCalledTimes(0); }); - it('Should to enable availabilty for just one device', async () => { + it('Should to enable availability for just one device', async () => { settings.set(['availability'], false); settings.set(['devices', devices.bulb_color.ieeeAddr, 'availability'], true); @@ -291,7 +291,7 @@ describe('Availability', () => { 'offline', {retain: true, qos: 1}, expect.any(Function)); }); - it('Should publish availabiltiy payload in JSON format', async () => { + it('Should publish availability payload in JSON format', async () => { settings.set(['advanced', 'legacy_availability_payload'], false); await resetExtension(); MQTT.publish.mockClear(); @@ -328,7 +328,7 @@ describe('Availability', () => { expect(devices.bulb_color.ping).toHaveBeenCalledTimes(1); }); - it('Should publish availabilty for groups', async () => { + it('Should publish availability for groups', async () => { settings.set(['devices', devices.bulb_color_2.ieeeAddr, 'availability'], true); await resetExtension(); expect(MQTT.publish).toHaveBeenCalledWith('zigbee2mqtt/group_tradfri_remote/availability',