azerty9971 / xtend_tuya

eXtend Tuya's integration
GNU General Public License v3.0
47 stars 4 forks source link

python errors #16

Closed masterkain closed 5 months ago

masterkain commented 5 months ago

1) do we need to disable main tuya integration in order to use this one? 2) I have python errors on startup:

2024-04-26 19:30:53.833 ERROR (MainThread) [homeassistant.components.sensor] Error adding entity sensor.rack_energia for domain sensor with platform xtend_tuya
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 580, in _async_add_entities
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 890, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1333, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/config/custom_components/xtend_tuya/sensor.py", line 256, in async_added_to_hass
    scaled_value_back = self._type_data.scale_value_back(state.native_value)
                                                         ^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'native_value'
masterkain commented 5 months ago

I think i got it working, perhaps the python errors are just on startup, thanks