Skip to content

Commit

Permalink
Quick modification of enumValue to correct a bug with TEC3000 (JCI) w…
Browse files Browse the repository at this point in the history
…here some weird multiStateValue are hard to resolve. More work to be done, take that as a quick fix.

Signed-off-by: Christian Tremblay <christian.tremblay@servisys.com>
  • Loading branch information
ChristianTremblay committed Aug 23, 2017
1 parent 51acd92 commit def8745
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion BAC0/core/devices/Points.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,13 @@ def enumValue(self):
"""
returns: (str) Enum state value
"""
return self.properties.units_state[int(self.history.dropna().iloc[-1]) - 1]
try:
return self.properties.units_state[int(self.history.dropna().iloc[-1]) - 1]
except IndexError:
value = 'unknown'
except ValueError:
value = 'NaN'
return value


@property
Expand Down
2 changes: 1 addition & 1 deletion BAC0/infos.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
__email__ = 'christian.tremblay@servisys.com'
__url__ = 'https://github.com/ChristianTremblay/BAC0'
__download_url__ = 'https://github.com/ChristianTremblay/BAC0/archive/master.zip'
__version__ = '0.99.105'
__version__ = '0.99.106'
__license__ = 'LGPLv3'

0 comments on commit def8745

Please sign in to comment.