enkama / hass-variables

Home Assistant variables component
90 stars 12 forks source link

Updating variable icon is broken in version 3 #46

Closed guillermorueda closed 1 year ago

guillermorueda commented 1 year ago

Before v3 I had an automation that was doing this: service: variable.update_sensor data: value: "a value" attributes: icon: "mdi:anIconFromAnotherEntity" last_value: "a value" last_icon: "{{ state_attr('ThisSensor', 'icon') }}" target: entity_id:

It was working great. After updating to v3 (and updating "variable" to "sensor"), my automation traces shows proper values for each of the attributes but the end result is that only the custom attributes (last_value and last_icon) are preserved, while the icon update is "ignored", resulting on the variable keeping the original icon that was setup on variable creation (which was imported from yaml during upgrade).