mirror of
https://github.com/bringout/oca-ocb-hw.git
synced 2026-04-18 03:22:07 +02:00
18 lines
496 B
Python
18 lines
496 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
import serial.tools.list_ports
|
|
|
|
from odoo.addons.hw_drivers.interface import Interface
|
|
|
|
|
|
class SerialInterface(Interface):
|
|
connection_type = 'serial'
|
|
|
|
def get_devices(self):
|
|
serial_devices = {}
|
|
for port in serial.tools.list_ports.comports():
|
|
serial_devices[port.device] = {
|
|
'identifier': port.device
|
|
}
|
|
return serial_devices
|