Skip to content

Commit e1080a0

Browse files
authored
colors theme: update packages (#1684)
* update packages * update dist package
1 parent 61135fc commit e1080a0

31 files changed

+198
-191
lines changed
Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,51 @@
11
{
22
"name": "wbcolortheme21",
3-
"version": "0.0.0",
3+
"version": "1.0.0",
44
"license": "MIT",
5+
"type": "module",
56
"scripts": {
67
"dev": "vite --host",
7-
"build": "vue-tsc --noEmit && vite build --base=/openWB/web/themes/colors --outDir=../web --emptyOutDir",
8+
"build-old": "vue-tsc --noEmit && vite build --base=/openWB/web/themes/colors --outDir=../web --emptyOutDir",
9+
"build": "run-p type-check \"build-only {@}\" --",
810
"preview": "vite preview --port 5050 --host",
9-
"typecheck": "vue-tsc --noEmit",
11+
"build-only": "vite build --base=/openWB/web/themes/colors --outDir=../web --emptyOutDir",
12+
"type-check": "vue-tsc --build --force",
1013
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
11-
"prettier-format": "prettier 'src/' --write"
14+
"format": "prettier 'src/' --write"
1215
},
1316
"dependencies": {
1417
"@popperjs/core": "^2.11.8",
15-
"bootstrap": "^5.3.0",
16-
"d3": "^7.8.5",
17-
"mqtt": "^5.1.0",
18+
"bootstrap": "^5.3.3",
19+
"d3": "^7.9.0",
20+
"mqtt": "^5.7.2",
1821
"process": "^0.11.10",
19-
"swiper": "^10.1.0",
22+
"swiper": "^11.1.4",
2023
"vue": "^3.3.4"
2124
},
2225
"devDependencies": {
23-
"@babel/types": "^7.22.5",
26+
"@babel/types": "^7.24.7",
2427
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
2528
"@esbuild-plugins/node-modules-polyfill": "^0.2.2",
26-
"@rushstack/eslint-patch": "^1.3.2",
27-
"@types/bootstrap": "^5.2.6",
28-
"@types/d3": "^7.1.0",
29-
"@types/node": "^20.3.1",
30-
"@typescript-eslint/eslint-plugin": "^6.7.4",
31-
"@typescript-eslint/parser": "^6.7.4",
32-
"@vitejs/plugin-vue": "^4.4.0",
33-
"@vue/eslint-config-prettier": "^8.0.0",
34-
"@vue/eslint-config-typescript": "^12.0.0",
35-
"@vue/tsconfig": "^0.4.0",
36-
"esbuild": "^0.19.4",
37-
"eslint": "^8.43.0",
38-
"eslint-plugin-vue": "^9.14.1",
39-
"prettier": "^3.0.1",
40-
"rollup": "3.x",
41-
"rollup-plugin-polyfill-node": "^0.12.0",
42-
"typescript": "^5.1.3",
43-
"vite": "^4.4.11",
44-
"vue-tsc": "^1.8.0"
29+
"@rushstack/eslint-patch": "^1.10.3",
30+
"@tsconfig/node20": "^20.1.4",
31+
"@types/bootstrap": "^5.2.10",
32+
"@types/d3": "^7.4.3",
33+
"@types/node": "^20.14.7",
34+
"@typescript-eslint/eslint-plugin": "^7.13.1",
35+
"@typescript-eslint/parser": "^7.13.1",
36+
"@vitejs/plugin-vue": "^5.0.5",
37+
"@vue/eslint-config-prettier": "^9.0.0",
38+
"@vue/eslint-config-typescript": "^13.0.0",
39+
"@vue/tsconfig": "^0.5.1",
40+
"esbuild": "^0.21.5",
41+
"eslint": "^8.57.0",
42+
"eslint-plugin-vue": "^9.26.0",
43+
"npm-run-all2": "^6.2.0",
44+
"prettier": "^3.3.2",
45+
"rollup": "^4.18.0",
46+
"rollup-plugin-polyfill-node": "^0.13.0",
47+
"typescript": "^5.5.2",
48+
"vite": "^5.3.1",
49+
"vue-tsc": "^2.0.21"
4550
}
4651
}

packages/modules/web_themes/colors/source/prettierrc.json

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
declare module 'mqtt/dist/mqtt.min' {
2+
import MQTT from 'mqtt'
3+
export = MQTT
4+
}

packages/modules/web_themes/colors/source/src/assets/js/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,6 @@ export function formatTemp(t: number) {
120120
return t != 999
121121
? (Math.round(t * 10) / 10).toLocaleString(undefined, {
122122
minimumFractionDigits: 1,
123-
}) + '°'
123+
}) + '°'
124124
: '-'
125125
}

packages/modules/web_themes/colors/source/src/assets/js/mqttClient.ts

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,16 @@
55
*/
66

77
// functions to interact with MQTT
8-
import {
9-
MqttClient,
10-
connect,
11-
type OnMessageCallback,
12-
type MqttProtocol,
13-
} from 'mqtt'
8+
9+
import mqtt from 'mqtt'
1410
import { type QoS } from 'mqtt-packet'
1511

1612
const defaultQoS: QoS = 0
1713
const mqttConnection = {
1814
host: location.hostname,
1915
port: location.protocol == 'https:' ? 443 : 80,
2016
endpoint: '/ws',
21-
protocol: (location.protocol == 'https:' ? 'wss' : 'ws') as MqttProtocol,
17+
protocol: (location.protocol == 'https:' ? 'wss' : 'ws') as mqtt.MqttProtocol,
2218
connectTimeout: 4000,
2319
reconnectPeriod: 4000,
2420
clean: false,
@@ -31,16 +27,15 @@ const subscription = {
3127
topic: '',
3228
qos: defaultQoS,
3329
}
34-
let client: MqttClient
30+
let client: mqtt.MqttClient
3531

36-
// export function MqttConnect(callback: (t: string, m: string) => void, topiclist: string[]) {
3732
const { host, port, endpoint, ...options } = mqttConnection
3833
const connectUrl = `${options.protocol}://${host}:${port}${endpoint}`
3934
try {
40-
client = connect(connectUrl, options)
35+
console.debug('connectURL', connectUrl)
36+
client = mqtt.connect(connectUrl, options)
4137
client.on('connect', () => {
4238
console.info('MQTT connection successful')
43-
//console.info (`mqtt client: ${mqttConnection.clientId}`)
4439
})
4540
client.on('disconnect', () => {
4641
console.info('MQTT disconnected')
@@ -53,7 +48,7 @@ try {
5348
}
5449

5550
//}
56-
export function mqttRegister(callback: OnMessageCallback) {
51+
export function mqttRegister(callback: mqtt.OnMessageCallback) {
5752
if (client) {
5853
client.on('message', callback)
5954
} else {
@@ -68,7 +63,6 @@ export function mqttSubscribe(toTopic: string) {
6863
console.error('MQTT Subscription error: ' + error)
6964
return
7065
}
71-
//console.info("MQTT Subscription successful: " + toTopic);
7266
})
7367
}
7468
export function mqttUnsubscribe(fromTopic: string) {
@@ -79,7 +73,6 @@ export function mqttUnsubscribe(fromTopic: string) {
7973
console.error('MQTT Unsubscribe from ' + fromTopic + ' failed: ' + error)
8074
return
8175
}
82-
//console.info ('MQTT unsubscribe successful: ' + topic)
8376
})
8477
}
8578
export async function mqttPublish(topic: string, message: string) {
@@ -92,7 +85,6 @@ export async function mqttPublish(topic: string, message: string) {
9285
connected = client.connected
9386
retries += 1
9487
}
95-
// console.warn ('MQTT publish: Now connected')
9688
if (retries < 20) {
9789
try {
9890
client.publish(topic, message, { qos }, (error) => {

packages/modules/web_themes/colors/source/src/components/batteryList/BLBattery.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ const statusstyle = computed(() => {
5555
props.bat.power < 0
5656
? 'var(--color-pv)'
5757
: props.bat.power > 0
58-
? 'var(--color-battery)'
59-
: 'var(--color-menu)'
58+
? 'var(--color-battery)'
59+
: 'var(--color-menu)'
6060
return { 'background-color': bgcolor }
6161
})
6262
</script>

packages/modules/web_themes/colors/source/src/components/batteryList/BatteryList.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ const statusstyle = computed(() => {
6868
sourceSummary.batOut.power > 0
6969
? 'var(--color-pv)'
7070
: usageSummary.batIn.power > 0
71-
? 'var(--color-battery)'
72-
: 'var(--color-menu)'
71+
? 'var(--color-battery)'
72+
: 'var(--color-menu)'
7373
return { 'background-color': bgcolor }
7474
})
7575
</script>

packages/modules/web_themes/colors/source/src/components/chargePointList/CPChargePoint.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@
212212
props.chargepoint.etActive
213213
? (
214214
Math.round(props.chargepoint.etMaxPrice * 10) / 10
215-
).toFixed(1) + ' ct'
215+
).toFixed(1) + ' ct'
216216
: '-'
217217
}}
218218

packages/modules/web_themes/colors/source/src/components/energyMeter/EnergyMeter.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ const usageDetails = computed(
180180
shcount > 1
181181
? [...shDevices.values()].filter(
182182
(row) => row.configured && row.showInGraph,
183-
)
183+
)
184184
: [],
185185
)
186186
.concat([usageSummary.batIn, usageSummary.house]),

packages/modules/web_themes/colors/source/src/components/powerGraph/PGSourceGraph.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,11 @@ const yScale = computed(() => {
9999
)
100100
})
101101
const keysToUse = computed(() => {
102-
if (graphData.graphMode != 'today' && graphData.graphMode != 'day') {
102+
if (
103+
graphData.graphMode != 'today' &&
104+
graphData.graphMode != 'day' &&
105+
graphData.graphMode != 'live'
106+
) {
103107
return ['evuIn', 'batOut', 'selfUsage', 'evuOut']
104108
} else if (globalConfig.showInverters) {
105109
const k = ['batOut', 'evuIn']

0 commit comments

Comments
 (0)