Skip to content

Commit 942ce11

Browse files
committed
Fix '--get security' (incorrect AdminMessage.ConfigType value).
requestConfig was assuming that the order of fields in meshtastic.LocalConfig matches the order of enum values in AdminMessage.ConfigType. This is true for 'device', 'position', etc. but is NOT true for 'security' due to the intervening 'version' field. Look up LocalConfig fields by name, not index, to prevent this error in the future. LocalConfig.security was introduced in meshtastic/protobufs#553
1 parent fee2b6c commit 942ce11

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

meshtastic/node.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,10 @@ def requestConfig(self, configType):
170170
p.get_config_request = configType
171171

172172
else:
173-
msgIndex = configType.index
174173
if configType.containing_type.name == "LocalConfig":
175-
p.get_config_request = msgIndex
174+
p.get_config_request = admin_pb2.AdminMessage.ConfigType.Value(configType.name.upper() + "_CONFIG")
176175
else:
177-
p.get_module_config_request = msgIndex
176+
p.get_module_config_request = configType.index
178177

179178
self._sendAdmin(p, wantResponse=True, onResponse=onResponse)
180179
if onResponse:

0 commit comments

Comments
 (0)