Skip to content

Commit badf727

Browse files
committed
Update the other factory reset to use integer too
1 parent c5fc51e commit badf727

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

meshtastic/node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ def factoryReset(self, full: bool = False):
728728
self.ensureSessionKey()
729729
p = admin_pb2.AdminMessage()
730730
if full:
731-
p.factory_reset_device = True
731+
p.factory_reset_device = 1
732732
logger.info(f"Telling node to factory reset (full device reset)")
733733
else:
734734
p.factory_reset_config = 1

meshtastic/tests/test_node.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ def test_factoryReset_config_uses_int_field():
269269
anode = Node(iface, 1234567890, noProto=True)
270270

271271
amesg = admin_pb2.AdminMessage()
272-
with patch("meshtastic.admin_pb2.AdminMessage", return_value=amesg):
272+
with patch("meshtastic.node.admin_pb2.AdminMessage", return_value=amesg):
273273
with patch.object(anode, "_sendAdmin") as mock_send_admin:
274274
anode.factoryReset(full=False)
275275

@@ -284,11 +284,11 @@ def test_factoryReset_full_sets_device_field():
284284
anode = Node(iface, 1234567890, noProto=True)
285285

286286
amesg = admin_pb2.AdminMessage()
287-
with patch("meshtastic.admin_pb2.AdminMessage", return_value=amesg):
287+
with patch("meshtastic.node.admin_pb2.AdminMessage", return_value=amesg):
288288
with patch.object(anode, "_sendAdmin") as mock_send_admin:
289289
anode.factoryReset(full=True)
290290

291-
assert amesg.factory_reset_device is True
291+
assert amesg.factory_reset_device == 1
292292
mock_send_admin.assert_called_once_with(amesg, onResponse=anode.onAckNak)
293293

294294

0 commit comments

Comments
 (0)