From 2835024f4543df8ed803c42c24db268f0ec55c0b Mon Sep 17 00:00:00 2001 From: Shai Yallin Date: Mon, 29 Sep 2025 11:07:35 +0300 Subject: [PATCH] added support for 1pm mini gen4 --- README.md | 1 + package-lock.json | 4 +-- src/devices/index.ts | 1 + src/devices/shelly-gen4-1-pm.ts | 43 +++++++++++++++++++++++++++++++++ 4 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 src/devices/shelly-gen4-1-pm.ts diff --git a/README.md b/README.md index ec5acfdd..ff436c24 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ For the first generation, see [node-shellies](https://github.com/alexryd/node-sh - [Shelly Pro Dimmer 1PM](https://shelly-api-docs.shelly.cloud/gen2/Devices/Gen2/ShellyProDimmer1PM) - [Shelly Pro Dimmer 0/1-10V PM](https://shelly-api-docs.shelly.cloud/gen2/Devices/Gen2/ShellyProDimmer0110VPM) - [Shelly Pro Dimmer 2PM](https://shelly-api-docs.shelly.cloud/gen2/Devices/Gen2/ShellyProDimmer2PM) +- [Shelly 1 PM Mini Gen4](https://shelly-api-docs.shelly.cloud/gen2/Devices/Gen4/ShellyMini1PMG4) 1 Support for outbound websockets is a work in progress. diff --git a/package-lock.json b/package-lock.json index 5ab8a697..5a436a5f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "shellies-ds9", - "version": "1.1.8", + "version": "1.1.9", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "shellies-ds9", - "version": "1.1.8", + "version": "1.1.9", "license": "GPL-3.0", "dependencies": { "@types/multicast-dns": "^7.2.4", diff --git a/src/devices/index.ts b/src/devices/index.ts index ff7e3270..e5001d11 100644 --- a/src/devices/index.ts +++ b/src/devices/index.ts @@ -20,3 +20,4 @@ export * from "./shelly-pro-dual-cover-pm"; export * from "./shelly-plus-dimmer-pm"; export * from "./shelly-plus-dimmer"; export * from "./shelly-gen3-2-pm"; +export * from "./shelly-gen4-1-pm"; diff --git a/src/devices/shelly-gen4-1-pm.ts b/src/devices/shelly-gen4-1-pm.ts new file mode 100644 index 00000000..c8b6ba3c --- /dev/null +++ b/src/devices/shelly-gen4-1-pm.ts @@ -0,0 +1,43 @@ +import { component, Device, MultiProfileDevice } from './base'; +import { + BluetoothLowEnergy, + Cloud, + Cover, + Input, + Mqtt, + OutboundWebSocket, + Script, + Switch, + WiFi, +} from '../components'; + +export class ShellyGen4Mini extends MultiProfileDevice { + static readonly model: string = "S4SW-001P8EU"; + static readonly modelName: string = "Shelly 1PM Gen4 Mini"; + + @component + readonly wifi = new WiFi(this); + + @component + readonly bluetoothLowEnergy = new BluetoothLowEnergy(this); + + @component + readonly cloud = new Cloud(this); + + @component + readonly mqtt = new Mqtt(this); + + @component + readonly outboundWebSocket = new OutboundWebSocket(this); + + @component + readonly input = new Input(this, 0); + + @component + readonly switch = new Switch(this, 0); + + @component + readonly script = new Script(this); +} + +Device.registerClass(ShellyGen4Mini); \ No newline at end of file