mirror of
https://github.com/skydiver/ewelink-api.git
synced 2025-12-21 21:33:11 +01:00
* specific error when requested channel is bigger than total * fix for multi-channel devices * updated test expectations * fixes with uiid api changes * fix wrong error message * added new test cases * return expected error on wrong channel number * added more devices * version bump
52 lines
1021 B
JavaScript
52 lines
1021 B
JavaScript
const loginExpectations = {
|
|
at: expect.any(String),
|
|
user: { email: expect.any(String) },
|
|
region: expect.any(String),
|
|
};
|
|
|
|
const allDevicesExpectations = {
|
|
name: expect.any(String),
|
|
deviceid: expect.any(String),
|
|
apikey: expect.any(String),
|
|
params: expect.any(Object),
|
|
showBrand: expect.any(Boolean),
|
|
extra: {
|
|
extra: {
|
|
uiid: expect.any(Number),
|
|
},
|
|
},
|
|
};
|
|
|
|
const specificDeviceExpectations = {
|
|
name: expect.any(String),
|
|
deviceid: expect.any(String),
|
|
apikey: expect.any(String),
|
|
online: expect.any(Boolean),
|
|
extra: {
|
|
extra: {
|
|
uiid: expect.any(Number),
|
|
},
|
|
},
|
|
};
|
|
|
|
const rawPowerUsageExpectations = {
|
|
status: 'ok',
|
|
data: {
|
|
hundredDaysKwhData: expect.any(String),
|
|
},
|
|
};
|
|
|
|
const currentMonthPowerUsageExpectations = {
|
|
status: 'ok',
|
|
monthly: expect.any(Number),
|
|
daily: expect.any(Array),
|
|
};
|
|
|
|
module.exports = {
|
|
loginExpectations,
|
|
allDevicesExpectations,
|
|
specificDeviceExpectations,
|
|
rawPowerUsageExpectations,
|
|
currentMonthPowerUsageExpectations,
|
|
};
|