From f90b5dc77243ed5ff2c535b028634ed61512ab29 Mon Sep 17 00:00:00 2001 From: Peter Wood Date: Wed, 19 Jun 2024 21:34:15 +0100 Subject: [PATCH] Don't write out values to config during loading. --- node_table.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/node_table.go b/node_table.go index 767b737..3cf731e 100644 --- a/node_table.go +++ b/node_table.go @@ -86,7 +86,9 @@ func (t *nodeTable) addOrUpdate(ieeeAddress zigbee.IEEEAddress, networkAddress z delete(t.networkToIEEE, node.NetworkAddress) node.NetworkAddress = networkAddress - converter.Store(s, "NetworkAddress", node.NetworkAddress, converter.NetworkAddressEncoder) + if !t.loading { + converter.Store(s, "NetworkAddress", node.NetworkAddress, converter.NetworkAddressEncoder) + } } } else { node = &zigbee.Node{ @@ -97,8 +99,10 @@ func (t *nodeTable) addOrUpdate(ieeeAddress zigbee.IEEEAddress, networkAddress z t.ieeeToNode[ieeeAddress] = node - converter.Store(s, "NetworkAddress", node.NetworkAddress, converter.NetworkAddressEncoder) - converter.Store(s, "LogicalType", node.LogicalType, converter.LogicalTypeEncoder) + if !t.loading { + converter.Store(s, "NetworkAddress", node.NetworkAddress, converter.NetworkAddressEncoder) + converter.Store(s, "LogicalType", node.LogicalType, converter.LogicalTypeEncoder) + } } t.networkToIEEE[networkAddress] = ieeeAddress