1- import { OeChartTester } from "src/app/shared/genericComponents/shared/tester" ;
1+ import { TimeUnit } from "chart.js" ;
2+ import { OeTester } from "src/app/shared/genericComponents/shared/testing/common" ;
3+ import { OeChartTester } from "src/app/shared/genericComponents/shared/testing/tester" ;
24import { QueryHistoricTimeseriesDataResponse } from "src/app/shared/jsonrpc/response/queryHistoricTimeseriesDataResponse" ;
35import { QueryHistoricTimeseriesEnergyPerPeriodResponse } from "src/app/shared/jsonrpc/response/queryHistoricTimeseriesEnergyPerPeriodResponse" ;
46import { QueryHistoricTimeseriesEnergyResponse } from "src/app/shared/jsonrpc/response/queryHistoricTimeseriesEnergyResponse" ;
@@ -86,7 +88,7 @@ export namespace History {
8688 "quarter" : "[Q]Q - YYYY" ,
8789 "year" : "YYYY"
8890 } ,
89- "unit" : period
91+ "unit" : period as TimeUnit
9092 } ,
9193 "bounds" : "ticks"
9294 }
@@ -168,7 +170,7 @@ export namespace History {
168170 "quarter" : "[Q]Q - YYYY" ,
169171 "year" : "YYYY"
170172 } ,
171- "unit" : period
173+ "unit" : period as TimeUnit
172174 } ,
173175 "offset" : true ,
174176 "bounds" : "ticks"
@@ -184,23 +186,13 @@ export namespace History {
184186 "responsive" : true
185187 }
186188 } ) ;
187- export type OeChannels = {
188-
189- /** Always one value for each channel from a {@link QueryHistoricTimeseriesEnergyResponse} */
190- energyChannelWithValues : QueryHistoricTimeseriesEnergyResponse ,
191-
192- /** data from a {@link QueryHistoricTimeseriesEnergyPerPeriodResponse} */
193- energyPerPeriodChannelWithValues ?: QueryHistoricTimeseriesEnergyPerPeriodResponse ,
194- /** data from a {@link QueryHistoricTimeseriesDataResponse} */
195- dataChannelWithValues ?: QueryHistoricTimeseriesDataResponse
196- }
197189
198190 /**
199191 * up to 288 datapoints (5 min aggregated values) from a
200192 *
201193 * {@link Day.energyPerPeriodChannelWithValues} and {@link Day.dataChannelWithValues}
202194 * */
203- export const DAY : History . OeChannels = ( {
195+ export const DAY : OeTester . Types . Channels = ( {
204196 energyChannelWithValues : new QueryHistoricTimeseriesEnergyResponse ( "0" , {
205197 data : {
206198 '_sum/GridBuyActiveEnergy' : 938 ,
@@ -1952,7 +1944,7 @@ export namespace History {
19521944 /**
19531945 * up to 164 datapoints(1 hour values) from a {@link Day.energyPerPeriodChannelWithValues} and {@link Day.dataChannelWithValues}
19541946 * */
1955- export const WEEK : OeChannels = {
1947+ export const WEEK : OeTester . Types . Channels = {
19561948 energyChannelWithValues : new QueryHistoricTimeseriesEnergyResponse ( "0" , {
19571949 data : {
19581950 '_sum/GridBuyActiveEnergy' : 2368 ,
@@ -3150,7 +3142,7 @@ export namespace History {
31503142
31513143 /**
31523144 * up to 31 datapoints(1 day values) from a {@link Day.energyPerPeriodChannelWithValues} and {@link Day.dataChannelWithValues}*/
3153- export const MONTH : OeChannels = {
3145+ export const MONTH : OeTester . Types . Channels = {
31543146 energyChannelWithValues : new QueryHistoricTimeseriesEnergyResponse ( "0" , {
31553147 data : {
31563148 '_sum/GridBuyActiveEnergy' : 773000 ,
@@ -3392,7 +3384,7 @@ export namespace History {
33923384
33933385 /**
33943386 * up to 12 datapoints(1 month values) from a {@link Day.energyPerPeriodChannelWithValues} and {@link Day.dataChannelWithValues}*/
3395- export const YEAR : OeChannels = {
3387+ export const YEAR : OeTester . Types . Channels = {
33963388 energyChannelWithValues : new QueryHistoricTimeseriesEnergyResponse ( "0" , {
33973389 data : {
33983390 '_sum/GridBuyActiveEnergy' : 23209000 ,
0 commit comments