home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.29k stars 30.61k forks source link

SAJ Solar inverter RecursionError: maximum recursion depth exceeded #71111

Closed toth2zoltan closed 2 years ago

toth2zoltan commented 2 years ago

The problem

The initialisation process results the following error: Logger: homeassistant.components.sensor Source: components/saj/sensor.py:212 Integration: Sensor (documentation, issues) First occurred: 3:01:15 PM (2 occurrences) Last logged: 3:01:15 PM

Error adding entities for domain sensor with platform saj Error while setting up saj platform for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 525, in _async_add_entity original_device_class=entity.device_class, File "/usr/src/homeassistant/homeassistant/components/saj/sensor.py", line 212, in device_class if self.unit_of_measurement == POWER_WATT: File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 375, in unit_of_measurement self.device_class == DEVICE_CLASS_TEMPERATURE File "/usr/src/homeassistant/homeassistant/components/saj/sensor.py", line 212, in device_class if self.unit_of_measurement == POWER_WATT: File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 375, in unit_of_measurement self.device_class == DEVICE_CLASS_TEMPERATURE .... File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 375, in unit_of_measurement self.device_class == DEVICE_CLASS_TEMPERATURE File "/usr/src/homeassistant/homeassistant/components/saj/sensor.py", line 212, in device_class if self.unit_of_measurement == POWER_WATT: RecursionError: maximum recursion depth exceeded

The root cause of the error: In sensor/init.py the SensorEntity.unit_of_measurement calls device_class property In saj/sensor.py in the SAJsensor(SensorEntity) class the deviuce_class calls unit_of_measurement

What version of Home Assistant Core has the issue?

Home Assistant Core 2022.5.0b4

What was the last working version of Home Assistant Core?

never

What type of installation are you running?

Home Assistant Container

Integration causing the issue

SAJ

Link to integration documentation on our website

https://www.home-assistant.io/integrations/saj/#full-configuration-example-for-wi-fi-inverters

Diagnostics information

No response

Example YAML snippet

- platform: saj
    name: inverter
    type: wifi
    host: ip_address_of_inverter

Anything in the logs that might be useful for us?

No response

Additional information

No response

probot-home-assistant[bot] commented 2 years ago

Hey there @fredericvl, mind taking a look at this issue as it has been labeled with an integration (saj) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)


saj documentation saj source (message by IssueLinks)

probot-home-assistant[bot] commented 2 years ago

sensor documentation sensor source (message by IssueLinks)

probot-home-assistant[bot] commented 2 years ago

Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (sensor) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)