mcclown / home-assistant-custom-components

Custom components for Home-Assistant
Apache License 2.0
18 stars 7 forks source link

ValueError: 2 is not a valid DeviceType #7

Open wouterlemcke opened 4 years ago

wouterlemcke commented 4 years ago

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
mcclown commented 4 years ago

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.

wouterlemcke commented 4 years ago

Thanks!