Skip to content

Commit f0458ab

Browse files
committed
fix custom climates being deleted on main config save
1 parent b0acaaa commit f0458ab

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed

src/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ const pageIcons = connect(
182182
twelveSoc,
183183
},
184184
},
185-
bl: Bluelink
185+
bl: Bluelink,
186186
) => {
187187
const lastSeen = new Date(lastUpdated)
188188
const batteryIcon = isCharging ? 'charging' : 'not-charging'

src/config.ts

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -156,20 +156,25 @@ export async function loadConfigScreen() {
156156
manufacturer: manufacturer,
157157
vin: vin,
158158
}) => {
159+
// read and combine with current saved config as other config screens may have changed settings (custom climates etc)
160+
const config = getConfig()
159161
setConfig({
160-
auth: {
161-
username: username,
162-
password: password,
163-
region: region,
164-
pin: pin,
162+
...config,
163+
...{
164+
auth: {
165+
username: username,
166+
password: password,
167+
region: region,
168+
pin: pin,
169+
},
170+
tempType: tempType,
171+
climateTempCold: climateTempCold,
172+
climateTempWarm: climateTempWarm,
173+
allowWidgetRemoteRefresh: allowWidgetRemoteRefresh,
174+
debugLogging: debugLogging,
175+
manufacturer: manufacturer?.toLowerCase(),
176+
vin: vin ? vin.toUpperCase() : undefined,
165177
},
166-
tempType: tempType,
167-
climateTempCold: climateTempCold,
168-
climateTempWarm: climateTempWarm,
169-
allowWidgetRemoteRefresh: allowWidgetRemoteRefresh,
170-
debugLogging: debugLogging,
171-
manufacturer: manufacturer?.toLowerCase(),
172-
vin: vin ? vin.toUpperCase() : undefined,
173178
} as Config)
174179
},
175180
onStateChange: (state, previousState): Partial<FlattenedConfig> => {

0 commit comments

Comments
 (0)