get map stream -> instrument from servicemanager for feeder
This commit is contained in:
@ -35,6 +35,7 @@ class SEHistory(InfluxDBWrapper):
|
||||
parser.optionxform = str
|
||||
parser.read([Path('~/.config/sehistory').expanduser()])
|
||||
section = parser[dbname] if dbname else parser[parser.sections()[0]]
|
||||
self.instrument_by_stream = {}
|
||||
super().__init__(*(section[k] for k in ('uri', 'token', 'org', 'bucket')), access=access)
|
||||
|
||||
def curves(self, start=None, stop=None, measurement=('*.value', '*.target'), field='float',
|
||||
@ -407,4 +408,6 @@ class SEHistory(InfluxDBWrapper):
|
||||
self.flush()
|
||||
|
||||
def add_stream(self, value, tags, key, ts):
|
||||
if value == '': # unknown instrument
|
||||
value = self.instrument or self.instrument_by_stream.get(key, '0')
|
||||
self.set_instrument(key, value, ts, **tags)
|
||||
|
Reference in New Issue
Block a user