preparing to add auth token into a .env file
This commit is contained in:
+2
-1
@@ -2,4 +2,5 @@ O.*
|
||||
.cvsignore
|
||||
testenv/
|
||||
__pycache__
|
||||
.pytest_cache
|
||||
.pytest_cache
|
||||
.env
|
||||
|
||||
+1
-4
@@ -1,9 +1,6 @@
|
||||
record(stringout, "$(DEVICE_NAME)_set_$(PARAMETER_NAME)_$(PARAMETER_ID)") {
|
||||
field(DTYP, "stream")
|
||||
|
||||
field(VAL, "Off")
|
||||
field(PINI, "YES")
|
||||
|
||||
field(PINI, "NO")
|
||||
field(OUT, "@$(DB)command.proto set($(PARAMETER_ID)) $(PORT)")
|
||||
}
|
||||
|
||||
|
||||
@@ -16,11 +16,15 @@ def readAscii(connexion_client : socket):
|
||||
match message[24]:
|
||||
case 'n':
|
||||
outlet_state[outlet_index] = 'On'
|
||||
print("powering on " + str(outlet_index))
|
||||
case 'f':
|
||||
outlet_state[outlet_index] = 'Off'
|
||||
print("powering off " + str(outlet_index))
|
||||
case 'e':
|
||||
outlet_state[outlet_index] = 'Restart'
|
||||
print("restarting " + str(outlet_index))
|
||||
if message[0] == 'G':
|
||||
print("sending current state report")
|
||||
time = datetime.datetime.now().strftime('%d %B %Y %H:%M:%S')
|
||||
connexion_client.send(bytes("Hidden Page\n" + time + "\nVersion: 1.5.0.1\n" +
|
||||
"M0:O1=" + outlet_state[0] + "\n"+
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
require ePowerSwitch,ponsin_h
|
||||
|
||||
epicsEnvSet("ASYN_PORT", "myDriverPort")
|
||||
epicsEnvSet("DB", "$(ePowerSwitch_DB)")
|
||||
|
||||
# I use HTTP to use TCP and disconnect after, but no disconnection is done, so I disconnect manually.
|
||||
drvAsynIPPortConfigure("$(ASYN_PORT)","127.0.0.1:55555 http", 0, 0, 0)
|
||||
|
||||
dbLoadTemplate("$(DB)template$(EPOWERSWITCH_SOCKET_NUMBER).substitutions", "PORT=$(ASYN_PORT), DEVICE_NAME=$(DEVICE_NAME), DB=$(DB)")
|
||||
|
||||
iocInit()
|
||||
@@ -2,8 +2,10 @@
|
||||
|
||||
if [ $1 -eq 4 -o $1 -eq 8 ]
|
||||
then
|
||||
source .env
|
||||
export DEVICE_NAME="ePowerSwitch"
|
||||
export EPOWERSWITCH_SOCKET_NUMBER=$1
|
||||
export
|
||||
echo "Starting ePowerSwitch drivers with $1 outlets"
|
||||
iocsh st.cmd
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user