sebr / bhyve-home-assistant

Orbit BHyve custom component for Home Assistant
MIT License
260 stars 42 forks source link

BETA - ImportError: cannot import name 'SensorStateClass' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py) #259

Closed dinan5 closed 2 months ago

dinan5 commented 2 months ago

Describe the bug Trying to install bhyve and I get the following error - ImportError: cannot import name 'SensorStateClass' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py)

Expected behaviour Expecting the component to properly complete installation

BHyve devices Orbit Sprinkler Controller Orbit Smart Hose Tap Timer

Device Diagnostics Error setting up entry xxxxxxxx@outlook.com for bhyve Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 604, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/bhyve/init.py", line 124, in async_setup_entry await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2085, in async_forward_entry_setups await integration.async_get_platforms(platforms) File "/usr/src/homeassistant/homeassistant/loader.py", line 1177, in async_get_platforms import_future.result() File "/usr/src/homeassistant/homeassistant/loader.py", line 1177, in async_get_platforms import_future.result() File "/usr/src/homeassistant/homeassistant/loader.py", line 1177, in async_get_platforms import_future.result() File "/usr/src/homeassistant/homeassistant/loader.py", line 1165, in async_get_platforms platforms.update(self._load_platforms(platform_names)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 1090, in _load_platforms platform_name: self._load_platform(platform_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 1264, in _load_platform cache[full_name] = self._import_platform(platform_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 1296, in _import_platform return importlib.import_module(f"{self.pkg_path}.{platform_name}") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/importlib/init.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1387, in _gcd_import File "", line 1360, in _find_and_load File "", line 1331, in _find_and_load_unlocked File "", line 935, in _load_unlocked File "", line 995, in exec_module File "", line 488, in _call_with_frames_removed File "/config/custom_components/bhyve/sensor.py", line 8, in from homeassistant.const import ATTR_BATTERY_LEVEL, SensorStateClass, UnitOfTemperature ImportError: cannot import name 'SensorStateClass' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py)

Please attach the Home Assistant diagnostics for the B-hyve device. Sensitive information is redacted when compiling the diagnostic data.

-->

ylwmamba commented 2 months ago

I'm having this exact same issue, however my integration was previously working and it broke around 2 weeks ago.

m-theredhead commented 2 months ago

New update available in HACS today resolves this issue for me.

sebr commented 2 months ago

Fixed in latest beta