Browse Source

Add if serial-port is in use

Joachim M. Giæver 1 year ago
parent
commit
e8d4e4daac
2 changed files with 2 additions and 2 deletions
  1. 0 1
      src/hooks/connect-plug-zui-store
  2. 2 1
      src/hooks/prepare-plug-zui-store

+ 0 - 1
src/hooks/connect-plug-zui-store

@@ -1,6 +1,5 @@
 #!/usr/bin/env bash
 
-snapctl get --slot :zui-store serial > "${SNAP_DATA}.zui-serial"
 $SNAP/bin/cpy-2-zui
 
 logger "Connected ZUI (from: z2m)"

+ 2 - 1
src/hooks/prepare-plug-zui-store

@@ -1,3 +1,4 @@
 #!/usr/bin/env bash
 
-snapctl set :zui-store plugattribute="$(snapctl get -d server mqtt session)"
+snapctl set :zui-store z2mconfig="$(snapctl get -d server mqtt session)"
+snapctl set :zui-store z2mserial="$(snapctl is-connected serial-port && echo 1 || echo 0)"