From 176395a200920dbfc8d05872662b9f0d9cae6a3d Mon Sep 17 00:00:00 2001 From: April7410 Date: Fri, 28 Apr 2023 15:27:11 -0400 Subject: [PATCH] adding Nm as an additional unit to parse --- src/rpi_ati_net_ft/rpi_ati_net_ft.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rpi_ati_net_ft/rpi_ati_net_ft.py b/src/rpi_ati_net_ft/rpi_ati_net_ft.py index 73b60d7..e784508 100644 --- a/src/rpi_ati_net_ft/rpi_ati_net_ft.py +++ b/src/rpi_ati_net_ft/rpi_ati_net_ft.py @@ -31,13 +31,13 @@ import socket import select import requests -from BeautifulSoup import BeautifulSoup +from bs4 import BeautifulSoup import numpy as np from collections import namedtuple import struct import time -NET_FT_device_settings=namedtuple('net_ft_settings', ['ft', 'conv', 'maxrange', 'bias', 'ipaddress', 'rdt_rate', 'device_status'], verbose=False) +NET_FT_device_settings=namedtuple('net_ft_settings', ['ft', 'conv', 'maxrange', 'bias', 'ipaddress', 'rdt_rate', 'device_status']) class NET_FT(object): @@ -74,7 +74,7 @@ def read_device_settings(self): if soup.find('scfgfu').text != 'N': raise Exception('ATI Net F/T must use MKS units') - if soup.find('scfgtu').text != 'Nm': + if soup.find('scfgtu').text != 'N-m' and soup.find('scfgtu').text !='Nm': raise Exception('ATI Net F/T must use MKS units') if soup.find('comrdte').text != "Enabled":