nodejs-poolcontroller 8.3.0 → 8.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +36 -36
- package/.github/ISSUE_TEMPLATE/1-bug-report.yml +84 -84
- package/.github/ISSUE_TEMPLATE/2-docs.md +12 -12
- package/.github/ISSUE_TEMPLATE/3-proposal.md +28 -28
- package/.github/ISSUE_TEMPLATE/config.yml +8 -8
- package/.github/copilot-instructions.md +63 -63
- package/.github/workflows/ghcr-publish.yml +67 -67
- package/AGENTS.md +597 -0
- package/CONTRIBUTING.md +74 -74
- package/Changelog +292 -284
- package/Dockerfile +62 -62
- package/Gruntfile.js +40 -40
- package/LICENSE +661 -661
- package/README.md +318 -309
- package/anslq25/MessagesMock.ts +221 -221
- package/anslq25/boards/MockBoardFactory.ts +49 -49
- package/anslq25/boards/MockEasyTouchBoard.ts +696 -696
- package/anslq25/boards/MockSystemBoard.ts +216 -216
- package/anslq25/chemistry/MockChlorinator.ts +98 -98
- package/anslq25/pumps/MockPump.ts +83 -83
- package/app.ts +115 -115
- package/config/Config.ts +0 -0
- package/config/VersionCheck.ts +0 -0
- package/controller/Constants.ts +809 -805
- package/controller/Equipment.ts +2688 -2664
- package/controller/Errors.ts +181 -181
- package/controller/Lockouts.ts +549 -549
- package/controller/State.ts +3738 -3701
- package/controller/boards/AquaLinkBoard.ts +1003 -1003
- package/controller/boards/BoardFactory.ts +53 -53
- package/controller/boards/EasyTouchBoard.ts +3202 -3202
- package/controller/boards/IntelliCenterBoard.ts +4393 -3899
- package/controller/boards/IntelliComBoard.ts +69 -69
- package/controller/boards/IntelliTouchBoard.ts +382 -382
- package/controller/boards/NixieBoard.ts +1944 -1944
- package/controller/boards/SunTouchBoard.ts +400 -400
- package/controller/boards/SystemBoard.ts +5268 -5268
- package/controller/comms/Comms.ts +1272 -1255
- package/controller/comms/ScreenLogic.ts +1665 -1665
- package/controller/comms/messages/Messages.ts +1433 -1406
- package/controller/comms/messages/config/ChlorinatorMessage.ts +5 -0
- package/controller/comms/messages/config/CircuitGroupMessage.ts +0 -0
- package/controller/comms/messages/config/CircuitMessage.ts +0 -0
- package/controller/comms/messages/config/ConfigMessage.ts +6 -0
- package/controller/comms/messages/config/CoverMessage.ts +0 -0
- package/controller/comms/messages/config/CustomNameMessage.ts +31 -31
- package/controller/comms/messages/config/EquipmentMessage.ts +216 -210
- package/controller/comms/messages/config/ExternalMessage.ts +96 -10
- package/controller/comms/messages/config/FeatureMessage.ts +0 -0
- package/controller/comms/messages/config/GeneralMessage.ts +0 -0
- package/controller/comms/messages/config/HeaterMessage.ts +0 -0
- package/controller/comms/messages/config/IntellichemMessage.ts +0 -0
- package/controller/comms/messages/config/OptionsMessage.ts +194 -174
- package/controller/comms/messages/config/PumpMessage.ts +0 -0
- package/controller/comms/messages/config/RemoteMessage.ts +0 -0
- package/controller/comms/messages/config/ScheduleMessage.ts +401 -390
- package/controller/comms/messages/config/SecurityMessage.ts +0 -0
- package/controller/comms/messages/config/ValveMessage.ts +0 -0
- package/controller/comms/messages/status/ChlorinatorStateMessage.ts +0 -0
- package/controller/comms/messages/status/EquipmentStateMessage.ts +1158 -822
- package/controller/comms/messages/status/HeaterStateMessage.ts +135 -135
- package/controller/comms/messages/status/IntelliChemStateMessage.ts +448 -448
- package/controller/comms/messages/status/IntelliValveStateMessage.ts +36 -36
- package/controller/comms/messages/status/PumpStateMessage.ts +0 -0
- package/controller/comms/messages/status/RegalModbusStateMessage.ts +410 -410
- package/controller/comms/messages/status/VersionMessage.ts +103 -41
- package/controller/nixie/Nixie.ts +173 -173
- package/controller/nixie/NixieEquipment.ts +104 -104
- package/controller/nixie/bodies/Body.ts +120 -120
- package/controller/nixie/bodies/Filter.ts +135 -135
- package/controller/nixie/chemistry/ChemController.ts +2724 -2724
- package/controller/nixie/chemistry/ChemDoser.ts +806 -806
- package/controller/nixie/chemistry/Chlorinator.ts +367 -367
- package/controller/nixie/circuits/Circuit.ts +478 -478
- package/controller/nixie/heaters/Heater.ts +834 -834
- package/controller/nixie/pumps/Pump.ts +1193 -1193
- package/controller/nixie/schedules/Schedule.ts +401 -401
- package/controller/nixie/valves/Valve.ts +170 -170
- package/defaultConfig.json +352 -352
- package/docker-compose.yml +31 -31
- package/logger/DataLogger.ts +448 -448
- package/logger/Logger.ts +448 -436
- package/package.json +58 -58
- package/sendSocket.js +32 -32
- package/tsconfig.json +25 -25
- package/types/express-multer.d.ts +32 -32
- package/web/Server.ts +1937 -1927
- package/web/bindings/aqualinkD.json +559 -559
- package/web/bindings/influxDB.json +1066 -1066
- package/web/bindings/mqtt.json +721 -721
- package/web/bindings/mqttAlt.json +746 -746
- package/web/bindings/rulesManager.json +54 -54
- package/web/bindings/smartThings-Hubitat.json +31 -31
- package/web/bindings/valveRelays.json +20 -20
- package/web/bindings/vera.json +25 -25
- package/web/interfaces/baseInterface.ts +188 -188
- package/web/interfaces/httpInterface.ts +148 -148
- package/web/interfaces/influxInterface.ts +283 -283
- package/web/interfaces/mqttInterface.ts +695 -695
- package/web/interfaces/ruleInterface.ts +101 -87
- package/web/services/config/Config.ts +1063 -1053
- package/web/services/config/ConfigSocket.ts +0 -0
- package/web/services/state/State.ts +0 -0
- package/web/services/state/StateSocket.ts +0 -0
- package/web/services/utilities/Utilities.ts +233 -233
package/Dockerfile
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
### Build stage
|
|
2
|
-
FROM node:20-alpine AS build
|
|
3
|
-
LABEL maintainer="nodejs-poolController"
|
|
4
|
-
LABEL org.opencontainers.image.title="nodejs-poolController"
|
|
5
|
-
LABEL org.opencontainers.image.description="Bridge Pentair / compatible pool automation equipment to modern interfaces (REST, WebSockets, MQTT, Influx, Rules)."
|
|
6
|
-
LABEL org.opencontainers.image.licenses="AGPL-3.0-only"
|
|
7
|
-
LABEL org.opencontainers.image.source="https://github.com/tagyoureit/nodejs-poolController"
|
|
8
|
-
|
|
9
|
-
# Install build toolchain only for native deps (serialport, etc.)
|
|
10
|
-
RUN apk add --no-cache make gcc g++ python3 linux-headers udev tzdata git
|
|
11
|
-
|
|
12
|
-
WORKDIR /app
|
|
13
|
-
|
|
14
|
-
# Leverage Docker layer caching: copy only manifests first
|
|
15
|
-
COPY package*.json ./
|
|
16
|
-
COPY defaultConfig.json config.json
|
|
17
|
-
|
|
18
|
-
# Install all deps (including dev) for build
|
|
19
|
-
RUN npm ci
|
|
20
|
-
|
|
21
|
-
# Copy source
|
|
22
|
-
COPY . .
|
|
23
|
-
|
|
24
|
-
# Build Typescript
|
|
25
|
-
RUN npm run build
|
|
26
|
-
|
|
27
|
-
# Remove dev dependencies while keeping a clean node_modules with prod deps only
|
|
28
|
-
RUN npm prune --production
|
|
29
|
-
|
|
30
|
-
### Runtime stage
|
|
31
|
-
FROM node:20-alpine AS prod
|
|
32
|
-
LABEL org.opencontainers.image.title="nodejs-poolController"
|
|
33
|
-
LABEL org.opencontainers.image.description="Bridge Pentair / compatible pool automation equipment to modern interfaces (REST, WebSockets, MQTT, Influx, Rules)."
|
|
34
|
-
LABEL org.opencontainers.image.licenses="AGPL-3.0-only"
|
|
35
|
-
LABEL org.opencontainers.image.source="https://github.com/tagyoureit/nodejs-poolController"
|
|
36
|
-
ENV NODE_ENV=production
|
|
37
|
-
|
|
38
|
-
# Use existing 'node' user from base image; just ensure work directory exists
|
|
39
|
-
WORKDIR /app
|
|
40
|
-
RUN mkdir -p /app
|
|
41
|
-
RUN mkdir -p /app/logs /app/data /app/backups /app/web/bindings/custom \
|
|
42
|
-
&& chown -R node:node /app/logs /app/data /app/backups /app/web/bindings /app/web/bindings/custom || true
|
|
43
|
-
|
|
44
|
-
# Copy only the necessary runtime artifacts from build stage
|
|
45
|
-
COPY --chown=node:node --from=build /app/package*.json ./
|
|
46
|
-
COPY --chown=node:node --from=build /app/node_modules ./node_modules
|
|
47
|
-
COPY --chown=node:node --from=build /app/dist ./dist
|
|
48
|
-
COPY --chown=node:node --from=build /app/defaultConfig.json ./defaultConfig.json
|
|
49
|
-
COPY --chown=node:node --from=build /app/config.json ./config.json
|
|
50
|
-
COPY --chown=node:node --from=build /app/README.md ./README.md
|
|
51
|
-
COPY --chown=node:node --from=build /app/LICENSE ./LICENSE
|
|
52
|
-
|
|
53
|
-
USER node
|
|
54
|
-
|
|
55
|
-
# Default HTTP / HTTPS (if enabled) ports from defaultConfig (http 4200, https 4201)
|
|
56
|
-
EXPOSE 4200 4201
|
|
57
|
-
|
|
58
|
-
# Basic healthcheck (container considered healthy if process responds to tcp socket open)
|
|
59
|
-
HEALTHCHECK --interval=45s --timeout=6s --start-period=40s --retries=4 \
|
|
60
|
-
CMD node -e "const n=require('net');const s=n.createConnection({host:'127.0.0.1',port:4200},()=>{s.end();process.exit(0)});s.on('error',()=>process.exit(1));setTimeout(()=>{s.destroy();process.exit(1)},5000);" || exit 1
|
|
61
|
-
|
|
62
|
-
ENTRYPOINT ["node", "dist/app.js"]
|
|
1
|
+
### Build stage
|
|
2
|
+
FROM node:20-alpine AS build
|
|
3
|
+
LABEL maintainer="nodejs-poolController"
|
|
4
|
+
LABEL org.opencontainers.image.title="nodejs-poolController"
|
|
5
|
+
LABEL org.opencontainers.image.description="Bridge Pentair / compatible pool automation equipment to modern interfaces (REST, WebSockets, MQTT, Influx, Rules)."
|
|
6
|
+
LABEL org.opencontainers.image.licenses="AGPL-3.0-only"
|
|
7
|
+
LABEL org.opencontainers.image.source="https://github.com/tagyoureit/nodejs-poolController"
|
|
8
|
+
|
|
9
|
+
# Install build toolchain only for native deps (serialport, etc.)
|
|
10
|
+
RUN apk add --no-cache make gcc g++ python3 linux-headers udev tzdata git
|
|
11
|
+
|
|
12
|
+
WORKDIR /app
|
|
13
|
+
|
|
14
|
+
# Leverage Docker layer caching: copy only manifests first
|
|
15
|
+
COPY package*.json ./
|
|
16
|
+
COPY defaultConfig.json config.json
|
|
17
|
+
|
|
18
|
+
# Install all deps (including dev) for build
|
|
19
|
+
RUN npm ci
|
|
20
|
+
|
|
21
|
+
# Copy source
|
|
22
|
+
COPY . .
|
|
23
|
+
|
|
24
|
+
# Build Typescript
|
|
25
|
+
RUN npm run build
|
|
26
|
+
|
|
27
|
+
# Remove dev dependencies while keeping a clean node_modules with prod deps only
|
|
28
|
+
RUN npm prune --production
|
|
29
|
+
|
|
30
|
+
### Runtime stage
|
|
31
|
+
FROM node:20-alpine AS prod
|
|
32
|
+
LABEL org.opencontainers.image.title="nodejs-poolController"
|
|
33
|
+
LABEL org.opencontainers.image.description="Bridge Pentair / compatible pool automation equipment to modern interfaces (REST, WebSockets, MQTT, Influx, Rules)."
|
|
34
|
+
LABEL org.opencontainers.image.licenses="AGPL-3.0-only"
|
|
35
|
+
LABEL org.opencontainers.image.source="https://github.com/tagyoureit/nodejs-poolController"
|
|
36
|
+
ENV NODE_ENV=production
|
|
37
|
+
|
|
38
|
+
# Use existing 'node' user from base image; just ensure work directory exists
|
|
39
|
+
WORKDIR /app
|
|
40
|
+
RUN mkdir -p /app
|
|
41
|
+
RUN mkdir -p /app/logs /app/data /app/backups /app/web/bindings/custom \
|
|
42
|
+
&& chown -R node:node /app/logs /app/data /app/backups /app/web/bindings /app/web/bindings/custom || true
|
|
43
|
+
|
|
44
|
+
# Copy only the necessary runtime artifacts from build stage
|
|
45
|
+
COPY --chown=node:node --from=build /app/package*.json ./
|
|
46
|
+
COPY --chown=node:node --from=build /app/node_modules ./node_modules
|
|
47
|
+
COPY --chown=node:node --from=build /app/dist ./dist
|
|
48
|
+
COPY --chown=node:node --from=build /app/defaultConfig.json ./defaultConfig.json
|
|
49
|
+
COPY --chown=node:node --from=build /app/config.json ./config.json
|
|
50
|
+
COPY --chown=node:node --from=build /app/README.md ./README.md
|
|
51
|
+
COPY --chown=node:node --from=build /app/LICENSE ./LICENSE
|
|
52
|
+
|
|
53
|
+
USER node
|
|
54
|
+
|
|
55
|
+
# Default HTTP / HTTPS (if enabled) ports from defaultConfig (http 4200, https 4201)
|
|
56
|
+
EXPOSE 4200 4201
|
|
57
|
+
|
|
58
|
+
# Basic healthcheck (container considered healthy if process responds to tcp socket open)
|
|
59
|
+
HEALTHCHECK --interval=45s --timeout=6s --start-period=40s --retries=4 \
|
|
60
|
+
CMD node -e "const n=require('net');const s=n.createConnection({host:'127.0.0.1',port:4200},()=>{s.end();process.exit(0)});s.on('error',()=>process.exit(1));setTimeout(()=>{s.destroy();process.exit(1)},5000);" || exit 1
|
|
61
|
+
|
|
62
|
+
ENTRYPOINT ["node", "dist/app.js"]
|
package/Gruntfile.js
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
module.exports = function(grunt) {
|
|
2
|
-
|
|
3
|
-
grunt.initConfig({
|
|
4
|
-
usebanner: {
|
|
5
|
-
taskName: {
|
|
6
|
-
options: {
|
|
7
|
-
position: 'top',
|
|
8
|
-
banner: `/* nodejs-poolController. An application to control pool equipment.
|
|
9
|
-
Copyright (C) 2016, 2017. Russell Goldin, tagyoureit. russ.goldin@gmail.com
|
|
10
|
-
|
|
11
|
-
This program is free software: you can redistribute it and/or modify
|
|
12
|
-
it under the terms of the GNU Affero General Public License as
|
|
13
|
-
published by the Free Software Foundation, either version 3 of the
|
|
14
|
-
License, or (at your option) any later version.
|
|
15
|
-
|
|
16
|
-
This program is distributed in the hope that it will be useful,
|
|
17
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
-
GNU Affero General Public License for more details.
|
|
20
|
-
|
|
21
|
-
You should have received a copy of the GNU Affero General Public License
|
|
22
|
-
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
|
-
*/`,
|
|
24
|
-
linebreak: true,
|
|
25
|
-
replace: false
|
|
26
|
-
},
|
|
27
|
-
files: {
|
|
28
|
-
src: [ 'config/*.ts', 'controller/**/*.ts', 'logger/*.ts', 'web/**/*.ts', 'app.ts' ]
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
grunt.loadNpmTasks('grunt-banner');
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
1
|
+
module.exports = function(grunt) {
|
|
2
|
+
|
|
3
|
+
grunt.initConfig({
|
|
4
|
+
usebanner: {
|
|
5
|
+
taskName: {
|
|
6
|
+
options: {
|
|
7
|
+
position: 'top',
|
|
8
|
+
banner: `/* nodejs-poolController. An application to control pool equipment.
|
|
9
|
+
Copyright (C) 2016, 2017. Russell Goldin, tagyoureit. russ.goldin@gmail.com
|
|
10
|
+
|
|
11
|
+
This program is free software: you can redistribute it and/or modify
|
|
12
|
+
it under the terms of the GNU Affero General Public License as
|
|
13
|
+
published by the Free Software Foundation, either version 3 of the
|
|
14
|
+
License, or (at your option) any later version.
|
|
15
|
+
|
|
16
|
+
This program is distributed in the hope that it will be useful,
|
|
17
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
+
GNU Affero General Public License for more details.
|
|
20
|
+
|
|
21
|
+
You should have received a copy of the GNU Affero General Public License
|
|
22
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
|
+
*/`,
|
|
24
|
+
linebreak: true,
|
|
25
|
+
replace: false
|
|
26
|
+
},
|
|
27
|
+
files: {
|
|
28
|
+
src: [ 'config/*.ts', 'controller/**/*.ts', 'logger/*.ts', 'web/**/*.ts', 'app.ts' ]
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
grunt.loadNpmTasks('grunt-banner');
|
|
35
|
+
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
41
|
|