Skip to content

Commit

Permalink
Add hardware_name as config element
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomDietrich committed Jun 6, 2021
1 parent 1dfd24c commit f0cdff0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion bin/user/interceptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2517,6 +2517,8 @@ def __init__(self, **stn_dict):
if not self._device_type in self.DEVICE_TYPES:
raise TypeError("unsupported device type '%s'" % self._device_type)
loginf('device type: %s' % self._device_type)
self._hardware_name = stn_dict.pop('hardware_name', DEFAULT_HARDWARE_NAME)
loginf('hardware name: %s' % self._hardware_name)
self._queue_timeout = int(stn_dict.pop('queue_timeout', 10))
obs_map = stn_dict.pop('sensor_map', None)
obs_map_ext = stn_dict.pop('sensor_map_extensions', {})
Expand All @@ -2540,7 +2542,7 @@ def closePort(self):

@property
def hardware_name(self):
return self._device_type
return self._hardware_name

def genLoopPackets(self):
last_ts = 0
Expand Down Expand Up @@ -2599,6 +2601,9 @@ def genLoopPackets(self):
parser.add_option('--device', dest='device_type', metavar='DEVICE_TYPE',
default=DEFAULT_DEVICE_TYPE,
help='type of device for which to listen')
parser.add_option('--hardware_name', dest='hardware_name', metavar='HARDWARE_NAME',
default=DEFAULT_HARDWARE_NAME,
help='Short nickname for the weather station hardware')
parser.add_option('--data', dest='data', metavar='DATA',
default='',
help='data string for parse testing')
Expand Down
2 changes: 1 addition & 1 deletion install.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def loader():
class InterceptorInstaller(ExtensionInstaller):
def __init__(self):
super(InterceptorInstaller, self).__init__(
version="0.54",
version="0.60",
name='interceptor',
description='Capture weather data from HTTP requests',
author="Matthew Wall",
Expand Down

0 comments on commit f0cdff0

Please sign in to comment.