Skip to content

Commit

Permalink
v4.1.1 (#168)
Browse files Browse the repository at this point in the history
## [4.1.1](https://github.com/homebridge-plugins/homebridge-noip/releases/tag/v4.1.1) (2025-01-25)

### What's Changes
- Housekeeping and updated dependencies.

**Full Changelog**: v4.1.0...v4.1.1
  • Loading branch information
donavanbecker authored Jan 26, 2025
1 parent dbeca82 commit d6eecf2
Show file tree
Hide file tree
Showing 12 changed files with 795 additions and 392 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ contact_links:
- name: Homebridge Discord Channel for No-IP
url: https://discord.gg/8fpZA4S
about: Please ask and answer questions here.
- name: Homebridge-noip - Pull Requests
- name: @homebridge-plugins/homebridge-noip - Pull Requests
url: https://github.com/homebridge-plugins/homebridge-noip/pulls
about: Please report security vulnerabilities here.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

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

## [4.1.1](https://github.com/homebridge-plugins/homebridge-noip/releases/tag/v4.1.1) (2025-01-25)

### What's Changes
- Housekeeping and updated dependencies.

**Full Changelog**: https://github.com/homebridge-plugins/homebridge-noip/compare/v4.1.0...v4.1.1

## [4.1.0](https://github.com/homebridge-plugins/homebridge-noip/releases/tag/v4.1.0) (2025-01-16)

### What's Changes
Expand Down
1,073 changes: 705 additions & 368 deletions package-lock.json

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@homebridge-plugins/homebridge-noip",
"displayName": "No-IP",
"type": "module",
"version": "4.1.0",
"version": "4.1.1",
"description": "The No-IP plugin allows you to update your No-IP hostname(s) for your homebridge instance.",
"author": {
"name": "donavanbecker",
Expand Down Expand Up @@ -40,7 +40,7 @@
],
"main": "dist/index.js",
"engines": {
"homebridge": "^1.8.5 || ^2.0.0 || ^2.0.0-beta.23 || ^2.0.0-alpha.37",
"homebridge": "^1.8.5 || ^2.0.0 || ^2.0.0-beta.26 || ^2.0.0-alpha.37",
"node": "^20 || ^22"
},
"scripts": {
Expand All @@ -61,31 +61,31 @@
"docs:theme": "typedoc --theme default-modern"
},
"dependencies": {
"@homebridge/plugin-ui-utils": "^2.0.0",
"@homebridge/plugin-ui-utils": "^2.0.1",
"rxjs": "^7.8.1",
"undici": "^7.2.3",
"undici": "^7.3.0",
"validator": "^13.12.0"
},
"devDependencies": {
"@antfu/eslint-config": "^3.14.0",
"@antfu/eslint-config": "^4.1.0",
"@types/aes-js": "^3.1.4",
"@types/debug": "^4.1.12",
"@types/fs-extra": "^11.0.4",
"@types/mdast": "^4.0.4",
"@types/node": "^22.10.7",
"@types/node": "^22.10.10",
"@types/semver": "^7.5.8",
"@types/source-map-support": "^0.5.10",
"@typhonjs-typedoc/typedoc-theme-dmt": "^0.3.1",
"@vitest/coverage-v8": "^3.0.0",
"eslint": "^9.18.0",
"@vitest/coverage-v8": "^3.0.4",
"eslint": "^9.19.0",
"eslint-plugin-format": "^1.0.1",
"homebridge": "^1.8.5",
"homebridge-config-ui-x": "4.68.0",
"homebridge-config-ui-x": "4.69.0",
"nodemon": "^3.1.9",
"shx": "^0.3.4",
"ts-node": "^10.9.2",
"typedoc": "^0.27.6",
"typescript": "^5.7.3",
"vitest": "^3.0.0"
"vitest": "^3.0.4"
}
}
6 changes: 3 additions & 3 deletions src/devices/contactsensor.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/* Copyright(C) 2021-2024, donavanbecker (https://github.com/donavanbecker). All rights reserved.
*
* contactsensor.ts: homebridge-noip.
* contactsensor.ts: @homebridge-plugins/homebridge-noip.
*/

import type { CharacteristicValue, PlatformAccessory, Service } from 'homebridge'

import type { NoIPPlatform } from '../platform.js'
import type { devicesConfig } from '../settings.js'

import { Buffer } from 'node:buffer'

import { interval, throwError } from 'rxjs'
import { skipWhile, timeout } from 'rxjs/operators'
import { request } from 'undici'

import { type devicesConfig, noip } from '../settings.js'
import { noip } from '../settings.js'
import { deviceBase } from './device.js'

/**
Expand Down
6 changes: 3 additions & 3 deletions src/devices/device.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { API, CharacteristicValue, HAP, Logging, PlatformAccessory, Service } from 'homebridge'

/* Copyright(C) 2021-2024, donavanbecker (https://github.com/donavanbecker). All rights reserved.
*
* device.ts: homebridge-noip.
* device.ts: @homebridge-plugins/homebridge-noip.
*/
import type { API, CharacteristicValue, HAP, Logging, PlatformAccessory, Service } from 'homebridge'

import type { NoIPPlatform } from '../platform.js'
import type { devicesConfig, NoIPPlatformConfig } from '../settings.js'

Expand Down
4 changes: 2 additions & 2 deletions src/homebridge-ui/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import fs from 'node:fs'

/* Copyright(C) 2021-2024, donavanbecker (https://github.com/donavanbecker). All rights reserved.
*
* server.ts: homebridge-noip.
* server.ts: @homebridge-plugins/homebridge-noip.
*/
import { HomebridgePluginUiServer } from '@homebridge/plugin-ui-utils'

Expand All @@ -15,7 +15,7 @@ class PluginUiServer extends HomebridgePluginUiServer {
*/
this.onRequest('getCachedAccessories', () => {
try {
const plugin = 'homebridge-noip'
const plugin = '@homebridge-plugins/homebridge-noip'
const devicesToReturn = []

// The path and file of the cached accessories
Expand Down
19 changes: 19 additions & 0 deletions src/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import type { API } from 'homebridge'

import { describe, expect, it, vi } from 'vitest'

import registerPlatform from './index.js'
import { NoIPPlatform } from './platform.js'
import { PLATFORM_NAME, PLUGIN_NAME } from './settings.js'

describe('registerPlatform', () => {
it('should register the platform with homebridge', () => {
const api = {
registerPlatform: vi.fn(),
} as unknown as API

registerPlatform(api)

expect(api.registerPlatform).toHaveBeenCalledWith(PLUGIN_NAME, PLATFORM_NAME, NoIPPlatform)
})
})
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* Copyright(C) 2021-2023, donavanbecker (https://github.com/donavanbecker). All rights reserved.
*
* index.ts: homebridge-noip.
*/import type { API } from 'homebridge'
* index.ts: @homebridge-plugins/homebridge-noip.
*/
import type { API } from 'homebridge'

import { NoIPPlatform } from './platform.js'
import { PLATFORM_NAME, PLUGIN_NAME } from './settings.js'
Expand Down
13 changes: 12 additions & 1 deletion src/platform.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Copyright(C) 2021-2024, donavanbecker (https://github.com/donavanbecker). All rights reserved.
*
* platform.ts: homebridge-noip.
* platform.ts: @homebridge-plugins/homebridge-noip.
*/
import type { API, DynamicPlatformPlugin, HAP, Logging, PlatformAccessory } from 'homebridge'

Expand Down Expand Up @@ -174,6 +174,11 @@ export class NoIPPlatform implements DynamicPlatformPlugin {
? await this.validateAndCleanDisplayName(device.configDeviceName, 'configDeviceName', device.userDefinedDeviceName)
: await this.validateAndCleanDisplayName(hostname, 'hostname', hostname)

// Ensure displayName is not empty
if (!existingAccessory.displayName) {
existingAccessory.displayName = 'Unnamed Accessory'
}

existingAccessory.context.serialNumber = device.ipv4or6 === 'ipv6' ? await this.publicIPv6(device) : await this.publicIPv4(device)
existingAccessory.context.model = 'DUC'
existingAccessory.context.version = await this.getVersion()
Expand All @@ -199,6 +204,12 @@ export class NoIPPlatform implements DynamicPlatformPlugin {
accessory.displayName = device.configDeviceName
? await this.validateAndCleanDisplayName(device.configDeviceName, 'configDeviceName', device.userDefinedDeviceName)
: await this.validateAndCleanDisplayName(hostname, 'hostname', hostname)

// Ensure displayName is not empty
if (!accessory.displayName) {
accessory.displayName = 'Unnamed Accessory'
}

accessory.context.serialNumber = device.ipv4or6 === 'ipv6' ? await this.publicIPv6(device) : await this.publicIPv4(device)
accessory.context.model = 'DUC'
accessory.context.version = await this.getVersion()
Expand Down
27 changes: 27 additions & 0 deletions src/settings.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { describe, expect, it } from 'vitest'

import { getmyip_v4, getmyip_v6, ipapi_v4, ipapi_v6, ipify_v4, ipify_v6, ipinfo_v4, ipinfo_v6, myip_v4, myip_v6, noip, PLATFORM_NAME, PLUGIN_NAME } from './settings.js'

describe('settings', () => {
it('should have correct PLATFORM_NAME', () => {
expect(PLATFORM_NAME).toBe('NoIP')
})

it('should have correct PLUGIN_NAME', () => {
expect(PLUGIN_NAME).toBe('@homebridge-plugins/homebridge-noip')
})

it('should have correct API URLs', () => {
expect(ipinfo_v4).toBe('https://ipinfo.io/json')
expect(getmyip_v4).toBe('https://ipv4.getmyip.dev')
expect(ipify_v4).toBe('https://api.ipify.org?format=json')
expect(ipapi_v4).toBe('https://ipapi.co/json')
expect(myip_v4).toBe('https://api4.my-ip.io/v2/ip.json')
expect(ipinfo_v6).toBe('https://v6.ipinfo.io/json')
expect(getmyip_v6).toBe('https://ipv6.getmyip.dev')
expect(ipify_v6).toBe('https://api64.ipify.org?format=json')
expect(ipapi_v6).toBe('https://ip6api.co/json')
expect(myip_v6).toBe('https://api6.my-ip.io/v2/ip.txt')
expect(noip).toBe('https://dynupdate.no-ip.com/nic/update')
})
})
5 changes: 3 additions & 2 deletions src/settings.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/* Copyright(C) 2021-2024, donavanbecker (https://github.com/donavanbecker). All rights reserved.
*
* settings.ts: homebridge-noip.
* settings.ts: @homebridge-plugins/homebridge-noip.
*/
import type { PlatformConfig } from 'homebridge'

/**
* This is the name of the platform that users will use to register the plugin in the Homebridge config.json
*/
Expand All @@ -11,7 +12,7 @@ export const PLATFORM_NAME = 'NoIP'
/**
* This must match the name of your plugin as defined the package.json
*/
export const PLUGIN_NAME = 'homebridge-noip'
export const PLUGIN_NAME = '@homebridge-plugins/homebridge-noip'

// API URLs
export const ipinfo_v4 = 'https://ipinfo.io/json'
Expand Down

0 comments on commit d6eecf2

Please sign in to comment.