Created
June 12, 2020 07:36
-
-
Save glance-/3586ac05cc00b3e74b4bb2707837be08 to your computer and use it in GitHub Desktop.
use hass-cli to edit lovelace config as yaml in vim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# make edit_lovelace-ui.yml | |
edit_lovelace-ui.yml: | |
TMPFILE=$$(mktemp /tmp/XXXXXX-lovelace-ui.yml) ; \ | |
~/lap/homeassistant/bin/hass-cli raw ws lovelace/config > "$${TMPFILE}" ; \ | |
perl -pi -e 'BEGIN {undef $$/;} s/^id: 1\ntype: result\nsuccess: true\nresult:\n/config:\n/' "$${TMPFILE}"; \ | |
vim "$${TMPFILE}" ; \ | |
~/lap/homeassistant/bin/hass-cli raw ws lovelace/config/save --yaml "@$${TMPFILE}" && \ | |
rm -f "$${TMPFILE}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Btw, home-assistant-ecosystem/home-assistant-cli#319 is needed to get yaml/file-support