Skip to content

Commit

Permalink
Check for UNDEF in items
Browse files Browse the repository at this point in the history
fixes baaym#1
  • Loading branch information
imaginator authored May 14, 2019
1 parent 42b1f30 commit 04d4414
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion openhab2-exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def print_metrics(metrics, type, timestamp):
name = metric['name']
value = metric['state']

if value is None or value == 'NULL':
if value is None or value == 'NULL' or value == 'UNDEF': continue

This comment has been minimized.

Copy link
@gersilex

gersilex May 14, 2019

Just what I thought :) Just one small pythonic suggestion:

if value in [None, 'NULL', 'UNDEF']:
continue

if metric['type'].lower() == 'switch':
Expand Down

0 comments on commit 04d4414

Please sign in to comment.