Remove MQTT state vacuum value_template support.#33536
Remove MQTT state vacuum value_template support.#33536balloob merged 2 commits intohome-assistant:devfrom
Conversation
|
Hey there @home-assistant/core, mind taking a look at this pull request as its been labeled with a integration ( |
|
@pszafer Please review if you have time. |
|
I found one repo which uses string as but I think it couldn't work as author of this repo expected. |
|
@pszafer I think the code in your example won't be affected by this PR. Seems well aligned with the state vacuum MQTT schema without a |
| payload = template.async_render_with_possible_json_value(payload) | ||
| else: | ||
| payload = json.loads(payload) | ||
| payload = json.loads(payload) |
There was a problem hiding this comment.
What happens if JSON parsing fails?
There was a problem hiding this comment.
We don't allow templates to render JSON that needs to be parsed.
| payload = template.async_render_with_possible_json_value(payload) | ||
| else: | ||
| payload = json.loads(payload) | ||
| payload = json.loads(payload) |
There was a problem hiding this comment.
We don't allow templates to render JSON that needs to be parsed.
|
@balloob The payload expected on the This is similar to https://www.home-assistant.io/integrations/sensor.mqtt/#json-attributes-template-configuration. Since the current implementation of the |
|
This is the implementation of core/homeassistant/components/mqtt/__init__.py Lines 1063 to 1079 in b10319f |
|
PR updated to remove |
Proposed change
Remove MQTT state vacuum
value_templatesupport.The implementation is not working, so this can not be considered a breaking change.
Type of change
Additional information
Checklist
black --fast homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.The integration reached or maintains the following Integration Quality Scale: