-
-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merging to sync - still need to fix system.ts
- Loading branch information
Showing
20 changed files
with
171 additions
and
150 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,7 @@ | ||
import { AXIOS, alovaInstance } from './endpoints'; | ||
import type { AxiosPromise } from 'axios'; | ||
import { alovaInstance } from './endpoints'; | ||
|
||
import type { APSettings, APStatus } from 'types'; | ||
|
||
export const readAPStatus = () => alovaInstance.Get<APStatus>('/apStatus'); | ||
|
||
// TODO change APSettings AXIOS to Alova | ||
export function readAPSettings(): AxiosPromise<APSettings> { | ||
return AXIOS.get('/apSettings'); | ||
} | ||
export function updateAPSettings(apSettings: APSettings): AxiosPromise<APSettings> { | ||
return AXIOS.post('/apSettings', apSettings); | ||
} | ||
export const readAPStatus = () => alovaInstance.Get<APStatus>('/rest/apStatus'); | ||
export const readAPSettings = () => alovaInstance.Get<APSettings>('/rest/apSettings'); | ||
export const updateAPSettings = (data: APSettings) => alovaInstance.Post<APSettings>('/rest/apSettings', data); |
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 |
---|---|---|
@@ -1,16 +1,6 @@ | ||
import { AXIOS } from './endpoints'; | ||
import type { AxiosPromise } from 'axios'; | ||
import { alovaInstance } from './endpoints'; | ||
import type { MqttSettings, MqttStatus } from 'types'; | ||
|
||
// TODO move to alova | ||
export function readMqttStatus(): AxiosPromise<MqttStatus> { | ||
return AXIOS.get('/mqttStatus'); | ||
} | ||
|
||
export function readMqttSettings(): AxiosPromise<MqttSettings> { | ||
return AXIOS.get('/mqttSettings'); | ||
} | ||
|
||
export function updateMqttSettings(mqttSettings: MqttSettings): AxiosPromise<MqttSettings> { | ||
return AXIOS.post('/mqttSettings', mqttSettings); | ||
} | ||
export const readMqttStatus = () => alovaInstance.Get<MqttStatus>('/rest/mqttStatus'); | ||
export const readMqttSettings = () => alovaInstance.Get<MqttSettings>('/rest/mqttSettings'); | ||
export const updateMqttSettings = (data: MqttSettings) => alovaInstance.Post<MqttSettings>('/rest/mqttSettings', data); |
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 |
---|---|---|
@@ -1,25 +1,11 @@ | ||
import { AXIOS } from './endpoints'; | ||
import type { AxiosPromise } from 'axios'; | ||
import { alovaInstance } from './endpoints'; | ||
|
||
import type { WiFiNetworkList, NetworkSettings, NetworkStatus } from 'types'; | ||
|
||
// TODO move to alova | ||
export function readNetworkStatus(): AxiosPromise<NetworkStatus> { | ||
return AXIOS.get('/networkStatus'); | ||
} | ||
|
||
export function scanNetworks(): AxiosPromise<void> { | ||
return AXIOS.get('/scanNetworks'); | ||
} | ||
|
||
export function listNetworks(): AxiosPromise<WiFiNetworkList> { | ||
return AXIOS.get('/listNetworks'); | ||
} | ||
|
||
export function readNetworkSettings(): AxiosPromise<NetworkSettings> { | ||
return AXIOS.get('/networkSettings'); | ||
} | ||
|
||
export function updateNetworkSettings(wifiSettings: NetworkSettings): AxiosPromise<NetworkSettings> { | ||
return AXIOS.post('/networkSettings', wifiSettings); | ||
} | ||
export const readNetworkStatus = () => alovaInstance.Get<NetworkStatus>('/rest/networkStatus'); | ||
export const scanNetworks = () => alovaInstance.Get('/rest/scanNetworks'); | ||
export const listNetworks = () => alovaInstance.Get<WiFiNetworkList>('/rest/listNetworks'); | ||
export const readNetworkSettings = () => | ||
alovaInstance.Get<NetworkSettings>('/rest/networkSettings', { name: 'networkSettings' }); | ||
export const updateNetworkSettings = (wifiSettings: NetworkSettings) => | ||
alovaInstance.Post<NetworkSettings>('/rest/networkSettings', wifiSettings); |
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 |
---|---|---|
@@ -1,20 +1,11 @@ | ||
import { AXIOS } from './endpoints'; | ||
import type { AxiosPromise } from 'axios'; | ||
import { alovaInstance } from './endpoints'; | ||
import type { NTPSettings, NTPStatus, Time } from 'types'; | ||
|
||
// TODO move to Alova | ||
export function readNTPStatus(): AxiosPromise<NTPStatus> { | ||
return AXIOS.get('/ntpStatus'); | ||
} | ||
export const readNTPStatus = () => alovaInstance.Get<NTPStatus>('/rest/ntpStatus'); | ||
export const readNTPSettings = () => | ||
alovaInstance.Get<NTPSettings>('/rest/ntpSettings', { | ||
name: 'ntpSettings' | ||
}); | ||
export const updateNTPSettings = (data: NTPSettings) => alovaInstance.Post<NTPSettings>('/rest/ntpSettings', data); | ||
|
||
export function readNTPSettings(): AxiosPromise<NTPSettings> { | ||
return AXIOS.get('/ntpSettings'); | ||
} | ||
|
||
export function updateNTPSettings(ntpSettings: NTPSettings): AxiosPromise<NTPSettings> { | ||
return AXIOS.post('/ntpSettings', ntpSettings); | ||
} | ||
|
||
export function updateTime(time: Time): AxiosPromise<Time> { | ||
return AXIOS.post('/time', time); | ||
} | ||
export const updateTime = (data: Time) => alovaInstance.Post<Time>('/rest/time', data); |
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
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
Oops, something went wrong.