summaryrefslogtreecommitdiff
path: root/addons/hw_posbox_homepage
diff options
context:
space:
mode:
authorlejeune quentin <qle@odoo.com>2020-02-27 10:35:59 +0000
committerlejeune quentin <qle@odoo.com>2020-03-02 09:01:11 +0000
commitee519c222f0d1aec3f1b4082bbd76d13dedd07b2 (patch)
tree5770ba6e8761c2189af7e6d7b3935344c9fe13b3 /addons/hw_posbox_homepage
parent159699b09c17ba4a56cc634e6ca2585f8a030384 (diff)
[REF] hw_posbox_homepage: Use helpers to get mac address in homepage
We use a library to get mac address of IoT in homepage. however we already have a function that does this in the helper in hw_drivers closes odoo/odoo#46631 X-original-commit: ae78e9cdde777ffac6f08a35dd00a540c92130bb Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
Diffstat (limited to 'addons/hw_posbox_homepage')
-rw-r--r--addons/hw_posbox_homepage/controllers/main.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/addons/hw_posbox_homepage/controllers/main.py b/addons/hw_posbox_homepage/controllers/main.py
index 37030cabac5..501a6f5aa91 100644
--- a/addons/hw_posbox_homepage/controllers/main.py
+++ b/addons/hw_posbox_homepage/controllers/main.py
@@ -15,7 +15,6 @@ from odoo.tools import misc
from pathlib import Path
import threading
-from uuid import getnode as get_mac
from odoo.addons.hw_proxy.controllers import main as hw_proxy
from odoo.addons.web.controllers import main as web
from odoo.modules.module import get_resource_path
@@ -59,8 +58,6 @@ class IoTboxHomepage(web.Home):
def get_homepage_data(self):
hostname = str(socket.gethostname())
- mac = get_mac()
- h = iter(hex(mac)[2:].zfill(12))
ssid = helpers.get_ssid()
wired = subprocess.check_output(['cat', '/sys/class/net/eth0/operstate']).decode('utf-8').strip('\n')
if wired == 'up':
@@ -84,7 +81,7 @@ class IoTboxHomepage(web.Home):
return {
'hostname': hostname,
'ip': helpers.get_ip(),
- 'mac': ":".join(i + next(h) for i in h),
+ 'mac': helpers.get_mac_address(),
'iot_device_status': iot_device,
'server_status': helpers.get_odoo_server_url() or 'Not Configured',
'network_status': network,