-
-
Notifications
You must be signed in to change notification settings - Fork 408
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: Split ValetudoWifiStatus from ValetudoWifiConfiguration
- Loading branch information
Showing
17 changed files
with
194 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
const SerializableEntity = require("../SerializableEntity"); | ||
|
||
|
||
class ValetudoWifiStatus extends SerializableEntity { | ||
/** | ||
* @param {object} options | ||
* @param {ValetudoWifiState} options.state | ||
* @param {object} options.details | ||
* @param {string} [options.details.ssid] | ||
* @param {number} [options.details.downspeed] unit: mbps | ||
* @param {number} [options.details.upspeed] unit: mbps | ||
* @param {number} [options.details.signal] unit: dBm | ||
* @param {Array<string>} [options.details.ips] all the ips that we can find | ||
* @param {ValetudoWifiStatusFrequencyType} [options.details.frequency] | ||
* @param {object} [options.metaData] | ||
* | ||
* @class | ||
*/ | ||
constructor(options) { | ||
super(options); | ||
|
||
this.state = options.state; | ||
this.details = options.details; | ||
} | ||
} | ||
|
||
/** | ||
* @typedef {string} ValetudoWifiStatusFrequencyType | ||
* @enum {string} | ||
* | ||
*/ | ||
ValetudoWifiStatus.FREQUENCY_TYPE = Object.freeze({ | ||
W2_4Ghz: "2.4ghz", //cannot start with a number. therefore prefixed with w | ||
W5Ghz: "5ghz" | ||
}); | ||
|
||
/** | ||
* @typedef {string} ValetudoWifiState | ||
* @enum {string} | ||
* | ||
*/ | ||
ValetudoWifiStatus.STATE = Object.freeze({ | ||
CONNECTED: "connected", | ||
NOT_CONNECTED: "not_connected", | ||
UNKNOWN: "unknown" | ||
}); | ||
|
||
|
||
module.exports = ValetudoWifiStatus; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
backend/lib/entities/core/doc/ValetudoWifiStatus.openapi.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"components": { | ||
"schemas": { | ||
"ValetudoWifiStatus": { | ||
"type": "object", | ||
"properties": { | ||
"state": { | ||
"type": "string", | ||
"enum": [ | ||
"connected", | ||
"not_connected", | ||
"unknown" | ||
] | ||
}, | ||
"details": { | ||
"type": "object", | ||
"properties": { | ||
"ssid": { | ||
"type": "string", | ||
"description": "Wireless network name" | ||
}, | ||
"downspeed": { | ||
"type": "number" | ||
}, | ||
"upspeed": { | ||
"type": "number" | ||
}, | ||
"signal": { | ||
"type": "number" | ||
}, | ||
"ips": { | ||
"type": "array", | ||
"description": "IP addresses", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"frequency": { | ||
"type": "string", | ||
"enum": [ | ||
"2.4ghz", | ||
"5ghz" | ||
] | ||
} | ||
} | ||
}, | ||
"metaData": { | ||
"type": "object" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 11 additions & 11 deletions
22
backend/lib/robots/common/miioCapabilities/MiioWifiConfigurationCapability.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.