home-assistant-custom-components icon indicating copy to clipboard operation
home-assistant-custom-components copied to clipboard

ValueError: 2 is not a valid DeviceType

Open wouterlemcke opened this issue 4 years ago • 2 comments

The Seneye sensor crashes for me on getting the device type (sensor.py:166).

I solved it by hardcoding it to 'pond'

>>> device_type = data.device_type.name
ValueError: 2 is not a valid DeviceType

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/dist-packages/pyseneye/sud.py", line 180, in device_type
    return DeviceType(self._device_type)
  File "/usr/lib/python3.7/enum.py", line 310, in __call__
    return cls.__new__(cls, value)
  File "/usr/lib/python3.7/enum.py", line 564, in __new__
    raise exc
  File "/usr/lib/python3.7/enum.py", line 548, in __new__
    result = cls._missing_(value)
  File "/usr/lib/python3.7/enum.py", line 577, in _missing_
    raise ValueError("%r is not a valid %s" % (value, cls.__name__))
ValueError: 2 is not a valid DeviceType

wouterlemcke avatar May 23 '20 11:05 wouterlemcke

Thanks for the bug report. I'd never had a Seneye Pond to test with before. It looks like pyseneye has an issue with it. I'll open a corresponding bug there as well.

mcclown avatar May 25 '20 12:05 mcclown

Thanks!

wouterlemcke avatar May 28 '20 23:05 wouterlemcke