dolezsa / thermal_comfort

Thermal Comfort sensor for HA (absolute humidity, heat index, dew point, thermal perception)
Other
584 stars 109 forks source link

2023.3.0b0 error #276

Closed DavidFW1960 closed 1 year ago

DavidFW1960 commented 1 year ago
Logger: homeassistant.components.sensor
Source: custom_components/thermal_comfort/sensor.py:473
Integration: Sensor (documentation, issues)
First occurred: 9:58:24 AM (1 occurrences)
Last logged: 9:58:24 AM

Error while setting up thermal_comfort platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 293, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/thermal_comfort/sensor.py", line 470, in async_setup_entry
    entities: list[SensorThermalComfort] = [
  File "/config/custom_components/thermal_comfort/sensor.py", line 473, in <listcomp>
    entity_description=SensorEntityDescription(**SENSOR_TYPES[sensor_type]),
TypeError: SensorEntityDescription.__init__() got an unexpected keyword argument 'native_precision'
VDRainer commented 1 year ago

Not sure if that's all, but according to https://developers.home-assistant.io/blog/2023/02/08/sensor_presentation_rounding/ and a little guess :smile: , replacing all native_precision with suggested_display_precision in sensor.py fixes this for me.

EDIT: Values are not rounded anymore, so that's only a partial solution. :cry: Some custom cards (here custom:secondaryinfo-entity-row) can't deal with it.

20230223_221626

DavidFW1960 commented 1 year ago

Thanks. Seems to have temporarily fixed it for me

VoyteckPL commented 1 year ago

I changed it and it still doesnt work

DavidFW1960 commented 1 year ago

I changed it and it still doesnt work

Then you didn't do it right

VDRainer commented 1 year ago

I changed it and it still doesnt work

Only the lower case ones? 20230224_072852 There are 7 in sensor.py

VoyteckPL commented 1 year ago

That did the job

Sweti934 commented 1 year ago

Also tried it, but I cant figure it out. changed all the native_precision lowercase to the suggested above. Should this have done the job?