Skip to content

Commit 8af3e17

Browse files
committed
add mac address to machine_data
1 parent d6dfecd commit 8af3e17

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

octoprint_simplyprint/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ def get_update_information(self):
428428
__plugin_name__ = "SimplyPrint Cloud"
429429
__plugin_pythoncompat__ = ">=3.7,<4"
430430
# Remember to bump the version in setup.py as well
431-
__plugin_version__ = "4.1.0rc1"
431+
__plugin_version__ = "4.1.0rc2"
432432

433433

434434
def __plugin_load__():

octoprint_simplyprint/websocket/system.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def get_system_info(self) -> Dict[str, Any]:
5858
info["core_count"] = os.cpu_count()
5959
info["total_memory"] = psutil.virtual_memory().total
6060
info.update(self.get_network_info())
61+
info["mac"] = self.get_mac_address()
6162

6263
port = self._get_public_port()
6364

@@ -69,6 +70,12 @@ def get_system_info(self) -> Dict[str, Any]:
6970
def _get_python_version(self) -> str:
7071
return ".".join(str(part) for part in sys.version_info[:3])
7172

73+
def get_mac_address():
74+
mac_int = uuid.getnode()
75+
mac_hex = "{:012x}".format(mac_int)
76+
mac_address = ":".join(mac_hex[i:i + 2] for i in range(0, 12, 2)).upper()
77+
return mac_address
78+
7279
def _get_routed_ip(self) -> Optional[str]:
7380
src_ip = None
7481
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
1616
# Remember to bump the version in octoprint_simplyprint/__init__.py as well
17-
plugin_version = "4.1.0rc1"
17+
plugin_version = "4.1.0rc2"
1818

1919
# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
2020
# module

0 commit comments

Comments
 (0)