enkama / hass-variables

Home Assistant variables component
89 stars 12 forks source link

replace_attributes is documented as optional, in fact required #95

Closed mjsambol closed 9 months ago

mjsambol commented 9 months ago

I've just recently updated to the latest version of this component available via HACS, and some of my automations began failing. After some poking around I've found that though the replace_attributes parameter to the update_sensor service is documented as optional, it is required, and this is true both for the newer update_sensor and the legacy set_variable. The Developer Tools / Services UI rejects calls to these services without that param and indicates:

This service requires field replace_attributes, which must be provided under data:

Scripts and automations which don't pass this field fail silently.

Either the documentation should be adjusted, or - far better for backward compatibility - the parameter should actually be optional.

Snuffy2 commented 9 months ago

Agreed, it should be optional. I'll get a PR to fix that.