Skip to content

Commit

Permalink
Don't write out values to config during loading.
Browse files Browse the repository at this point in the history
  • Loading branch information
pwood committed Jun 19, 2024
1 parent 2ff5601 commit f90b5dc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions node_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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
Expand Down

0 comments on commit f90b5dc

Please sign in to comment.