custom-components / pyscript

Pyscript adds rich Python scripting to HASS
Apache License 2.0
894 stars 47 forks source link

Translated state #588

Open SVH-Powel opened 8 months ago

SVH-Powel commented 8 months ago

This is a feature request.

Make support for translated state similar to what is possible in templates in HA 2024.3

https://rc.home-assistant.io/blog/2024/02/28/release-20243/#translating-states-in-your-templates

ALERTua commented 8 months ago

Looking at the code, it should work using hass.state_translated() in pyscript, as hass is a HomeAssistant instance, and state_translated is its field, as is state.