mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 08:19:52 +03:00
update mock api to work with latest changes
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user