Skip to content

Commit bf6cfdc

Browse files
authored
Merge pull request #164 from BambuTools/reboot
Reboot API
2 parents 97ba579 + c8f33aa commit bf6cfdc

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

bambulabs_api/client.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -780,3 +780,13 @@ def wifi_signal(self) -> str:
780780
str: Wifi signal
781781
"""
782782
return self.mqtt_client.wifi_signal()
783+
784+
def reboot(self) -> bool:
785+
"""
786+
Reboot printer. Warning: this will reboot printer and may require
787+
manual reconnecting.
788+
789+
Returns:
790+
bool: if printer has been rebooted correctly
791+
"""
792+
return self.mqtt_client.reboot()

bambulabs_api/mqtt_client.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,3 +1299,20 @@ def wifi_signal(self) -> str:
12991299
str: Wifi signal
13001300
"""
13011301
return self.__get_print("wifi_signal", "")
1302+
1303+
def reboot(self) -> bool:
1304+
"""
1305+
Reboot printer. Warning: this will reboot printer and may require
1306+
manual reconnecting.
1307+
1308+
Returns:
1309+
bool: if printer has been rebooted correctly
1310+
"""
1311+
logging.warning("Sending reboot command!")
1312+
return self.__publish_command(
1313+
{
1314+
"system": {
1315+
"command": "reboot"
1316+
}
1317+
}
1318+
)

0 commit comments

Comments
 (0)