Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
smartpublicbuilding
openhab-pb-stack
Commits
73fb4d7c
Commit
73fb4d7c
authored
Mar 11, 2019
by
dobli
Browse files
Use proper escape for backslashes and enable service
parent
03917724
Changes
1
Hide whitespace changes
Inline
Side-by-side
building_manager.py
View file @
73fb4d7c
...
...
@@ -1505,12 +1505,18 @@ def device_link_menu(base_dir):
"""
machine
=
docker_client_prompt
(
" to link device on"
)
device
=
qust
.
select
(
"What device should be linked?"
,
choices
=
USB_DEVICES
).
ask
()
# Start systemd service that ensures link
link_cmd
=
f
"sudo systemctl start swarm-device@"
+
\
f
"
{
device
}
\\\\
x20openhab.service"
execute_command_on_machine
(
link_cmd
,
machine
)
print
(
f
"Linked device
{
device
}
to openHAB service"
)
choices
=
USB_DEVICES
,
style
=
st
).
ask
()
# Start systemd service that ensures link (escapes of backslash needed)
link_cmd_start
=
f
"sudo systemctl status swarm-device@"
+
\
f
"
{
device
}
\\\\\\\\
x20openhab.service"
link_cmd_enable
=
f
"sudo systemctl status swarm-device@"
+
\
f
"
{
device
}
\\\\\\\\
x20openhab.service"
# Needs enable to keep after reboot
execute_command_on_machine
(
link_cmd_start
,
machine
)
execute_command_on_machine
(
link_cmd_enable
,
machine
)
print
(
f
"Linked device
{
device
}
to openHAB service on machine
{
machine
}
"
)
# *** Menu Helper Functions ***
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment