Skip to content

Commit

Permalink
fix(lib): add signal_type to geolocation params
Browse files Browse the repository at this point in the history
  • Loading branch information
manushak committed Apr 8, 2024
1 parent 1534b7b commit a1afbbb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/lib/watt-time/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ export const WattTimeGridEmissions = (): PluginInterface => {
longitude,
starttime: formatedStartTime.toString(),
endtime: formatedEndTime.toString(),
signal_type: input['signal-type'],
};

return await wattTimeAPI.fetchAndSortData(params);
Expand Down
1 change: 1 addition & 0 deletions src/lib/watt-time/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export interface WattTimeParams {
longitude: number;
starttime: string;
endtime: string;
signal_type?: string;
}

export interface WattTimeRegionParams {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/watt-time/watt-time-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const WattTimeAPI = () => {
* Throws an APIRequestError if an error occurs during the request or if the response is invalid.
*/
const fetchAndSortData = async (params: WattTimeParams) => {
const signalType = await getSignalType(token);
const signalType = params.signal_type || (await getSignalType(token));
Object.assign(params, {signal_type: signalType});

const response = await axios
Expand Down

0 comments on commit a1afbbb

Please sign in to comment.