-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathhub.ts
More file actions
18 lines (15 loc) · 421 Bytes
/
Copy pathhub.ts
File metadata and controls
18 lines (15 loc) · 421 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import type { Got } from 'got' with { 'resolution-mode': 'require' }
import type { Hub } from '../types/device/Hub'
export default (got: Got) => {
return {
async status() {
return await got.get(`hub/status`).json<Hub>()
},
async checkFirmwareUpdate() {
await got.put(`hub/ota/check`).json()
},
async installFirmwareUpdate() {
await got.put(`hub/ota/update`).json()
},
}
}