Skip to content

Commit 553f165

Browse files
committed
modify gpsd info
1 parent 30cb0c6 commit 553f165

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

modules/sensor/gps/gpsd.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,13 @@
4444
if res:
4545
message = json.loads(res.split('\n')[1])
4646
devices = message.get('devices')
47-
if devices:
48-
app_logger.info(f"devices: {devices}")
47+
if devices and type(devices) == list:
48+
driver = devices[0].get('driver')
49+
subtype1 = devices[0].get('subtype1')
50+
if driver:
51+
_SENSER_GPS_STR += f", {driver}"
52+
if subtype1:
53+
_SENSER_GPS_STR += f", {subtype1}"
4954

5055

5156
class GPSD(AbstractSensorGPS):

0 commit comments

Comments
 (0)