sureha icon indicating copy to clipboard operation
sureha copied to clipboard

Log Errors after installation on 2024.1.b0b

Open ChristophCaina opened this issue 2 years ago • 0 comments

I've installed the Integration today. All devices (Hub, Flap, cats) are available - and are showing some sensors, but in the logs, I am getting the following errors:

Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:360
Integration: Sensor ([documentation](https://rc.home-assistant.io/integrations/sensor), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+sensor%22))
First occurred: 1:19:06 PM (1 occurrences)
Last logged: 1:19:06 PM

Error while setting up sureha platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 360, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/sureha/sensor.py", line 59, in async_setup_entry
    entities.append(Flap(spc.coordinator, surepy_entity.id, spc))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/sureha/sensor.py", line 179, in __init__
    self._attr_entity_picture = self._surepy_entity.icon
                                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/surepy/entities/devices.py", line 247, in icon
    if self.state == LockState.LOCKED_ALL:
       ^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/surepy/entities/devices.py", line 235, in state
    return LockState(self._data["status"]["locking"]["mode"])
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
KeyError: 'mode'

Also, it seems that there are some constants that require changes (using HA 2024.1.0b0 (beta))

Logger: homeassistant.const
Source: helpers/deprecation.py:204
First occurred: 1:18:55 PM (14 occurrences)
Last logged: 1:19:06 PM

DEVICE_CLASS_BATTERY was used from sureha, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorDeviceClass.BATTERY instead, please create a bug report at https://github.com/benleb/sureha/issues
MASS_GRAMS was used from sureha, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfMass.GRAMS instead, please create a bug report at https://github.com/benleb/sureha/issues
VOLUME_MILLILITERS was used from sureha, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfVolume.MILLILITERS instead, please create a bug report at https://github.com/benleb/sureha/issues
DEVICE_CLASS_CONNECTIVITY was used from sureha, this is a deprecated constant which will be removed in HA Core 2025.1. Use BinarySensorDeviceClass.CONNECTIVITY instead, please create a bug report at https://github.com/benleb/sureha/issues
DEVICE_CLASS_PRESENCE was used from sureha, this is a deprecated constant which will be removed in HA Core 2025.1. Use BinarySensorDeviceClass.PRESENCE instead, please create a bug report at https://github.com/benleb/sureha/issues

ChristophCaina avatar Dec 28 '23 12:12 ChristophCaina