xZetsubou / hass-localtuya

🔹 A Home Assistant integration to handle Tuya devices locally "fork from localtuya"
https://xzetsubou.github.io/hass-localtuya/
GNU General Public License v3.0
366 stars 41 forks source link

[Bug]: Dont recognized m² as unit #288

Closed Destroyer061090 closed 2 months ago

Destroyer061090 commented 2 months ago

LocalTuya Version

2024.6.0

Home Assistant Version

Core 2024.6.4

Environment

What happened?

I setup the clean area of my vacuum with unit m² but system dont recognize it as a running distance

Steps to reproduce.

setup a sensor like this or without device class image

Relevant log output

Entity sensor.k2t_clean_area (<class 'custom_components.localtuya.sensor.LocalTuyaSensor'>) is using native unit of measurement 'm²' which is not a valid unit for the device class ('distance') it is using; expected one of ['m', 'in', 'yd', 'mi', 'ft', 'cm', 'mm', 'km']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/xZetsubou/hass-localtuya/issues

Diagnostics information.

No response

xZetsubou commented 2 months ago

Don't set a "device class" just use as unit of measurement and you can also use total or measurement as "state class"

Square meter is Area measurement not distance and HomeAssistant doesn't supports area as device class