update mock api to work with latest changes

This commit is contained in:
proddy
2021-07-19 16:44:46 +02:00
parent 561d1c0e55
commit add09e5a1c

View File

@@ -108,6 +108,8 @@ const network_settings = {
ssid: 'myWifi', ssid: 'myWifi',
password: 'myPassword', password: 'myPassword',
hostname: 'ems-esp', hostname: 'ems-esp',
nosleep: true,
tx_power: 20,
static_ip_config: false, static_ip_config: false,
} }
const network_status = { const network_status = {
@@ -282,7 +284,7 @@ const EMSESP_DEVICEDATA_ENDPOINT = REST_ENDPOINT_ROOT + 'deviceData'
const EMSESP_STATUS_ENDPOINT = REST_ENDPOINT_ROOT + 'emsespStatus' const EMSESP_STATUS_ENDPOINT = REST_ENDPOINT_ROOT + 'emsespStatus'
const EMSESP_BOARDPROFILE_ENDPOINT = REST_ENDPOINT_ROOT + 'boardProfile' const EMSESP_BOARDPROFILE_ENDPOINT = REST_ENDPOINT_ROOT + 'boardProfile'
const WRITE_VALUE_ENDPOINT = REST_ENDPOINT_ROOT + 'writeValue' const WRITE_VALUE_ENDPOINT = REST_ENDPOINT_ROOT + 'writeValue'
+const WRITE_SENSOR_ENDPOINT = REST_ENDPOINT_ROOT + 'writeSensor' const WRITE_SENSOR_ENDPOINT = REST_ENDPOINT_ROOT + 'writeSensor'
const emsesp_settings = { const emsesp_settings = {
tx_mode: 1, tx_mode: 1,
tx_delay: 0, tx_delay: 0,
@@ -909,6 +911,17 @@ app.post(WRITE_VALUE_ENDPOINT, (req, res) => {
res.sendStatus(200) res.sendStatus(200)
}) })
app.post(WRITE_SENSOR_ENDPOINT, (req, res) => {
const sensorname = req.body.sensorname
const id = sensorname.id
const no = sensorname.no
console.log(id)
console.log(no)
res.sendStatus(200)
})
app.post(EMSESP_BOARDPROFILE_ENDPOINT, (req, res) => { app.post(EMSESP_BOARDPROFILE_ENDPOINT, (req, res) => {
const board_profile = req.body.code const board_profile = req.body.code