From 9d89bcd842b432803a4f2cab291e67df99ad57b5 Mon Sep 17 00:00:00 2001 From: pdbjjens Date: Wed, 29 Jan 2025 16:18:46 +0100 Subject: [PATCH] Accept serial port by-id and by-path --- LICENSE | 2 +- README.md | 6 ++++-- main.js | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/LICENSE b/LICENSE index b0326ff..daf76dc 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2024 Jens-Peter Jensen jjensen@t-online.de +Copyright (c) 2025 Jens-Peter Jensen jjensen@t-online.de Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 9f76276..1c85891 100644 --- a/README.md +++ b/README.md @@ -49,8 +49,10 @@ A derived version of this adapter supporting control of VBus devices is availabl Placeholder for the next version (at the beginning of the line): ### **WORK IN PROGRESS** --> -### **WORK IN PROGRESS** +### **WORK IN PROGRESS** - 2025H1 maintenance release +* (pdbjjens) New: Accept serial port paths /dev/serial/by-id/usb-xxxxxxxxxxxxxxxxxxx or /dev/serial/by-path/platform-xxxxxxxxxxxxxxxxxxx +* (pdbjjens) Change: Migration to ESLint 9 * (simatec) Responsive Design added ### 0.4.0 (2024-08-13) - 2024H2 maintenance release @@ -94,7 +96,7 @@ The authors are in no way endorsed by or affiliated with RESOL GmbH, or any asso MIT License -Copyright (c) 2024 Jens-Peter Jensen +Copyright (c) 2025 Jens-Peter Jensen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/main.js b/main.js index 849da68..6a5e3f2 100644 --- a/main.js +++ b/main.js @@ -26,7 +26,7 @@ const ctx = { const adapterName = require('./package.json').name.split('.').pop(); const ipformat = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/; const fqdnformat = /^(?!:\/\/)(?=.{1,255}$)((.{1,63}\.){1,127}(?![0-9]*$)[a-z0-9-]+\.?)$/; -const serialformat = /^(COM|com)[0-9][0-9]?$|^\/dev\/tty.*$/; +const serialformat = /^(COM|com)[0-9][0-9]?$|^\/dev\/tty.*$|^\/dev\/serial\/by-id\/usb-.*$|^\/dev\/serial\/by-path\/platform-.*$/i; const vbusioformat = /vbus.io|vbus.net$/; // Currently unused: const urlformat = /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/;