Skip to content

Commit 28ec2c0

Browse files
author
Anze
committed
Only fetch information about entities which are devices (interfaces can't have credentials and sensors anyway)
1 parent fc07acb commit 28ec2c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

grafoleancollector/collector.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def fetch_job_configs(self, protocol):
247247
if r.status_code != 200:
248248
raise Exception("Network error, got status {} while retrieving {}/accounts/{}/entities".format(r.status_code, self.backend_url, account_id))
249249
j = r.json()
250-
entities_ids = [e["id"] for e in j["list"]]
250+
entities_ids = [e["id"] for e in j["list"] if e["entity_type"] == "device"]
251251

252252
for entity_id in entities_ids:
253253
r = requests_session.get('{}/accounts/{}/entities/{}?b={}'.format(self.backend_url, account_id, entity_id, self.bot_token))

0 commit comments

Comments
 (0)