GithubHelp home page GithubHelp logo

GA Power Testing about southern-company-api HOT 5 OPEN

Ross-Rob avatar Ross-Rob commented on July 18, 2024
GA Power Testing

from southern-company-api.

Comments (5)

Ross-Rob avatar Ross-Rob commented on July 18, 2024

Also Output from command prompt
image

from southern-company-api.

apearson avatar apearson commented on July 18, 2024

The first error seems to be in your .env or environment variables. Make sure the accounts is in the format "["123123", "123154235"]"

The second issue, to debug change .json to .text here

const resData: MonthlyDataResponse[] = await Promise.all(responses.map((response)=> response.json()));

and put a console.log(resData right above this line

/* Grabbing data from all responses */

from southern-company-api.

Ross-Rob avatar Ross-Rob commented on July 18, 2024

I only have one account so I just used the accounts format you posted with the same account number twice.

The json output looked like this:

> [
    {
        StatusCode: 200,
        Message: 'Successfully retrieved My Power Usage data for Monthly Graph',
        MessageType: 0,
        Data: {
        contractriderDesc: null,
        Data: '{"graphset":[{"background-color":"transparent","plotarea":{"margin":"dynamic"},"chart":{"background-color":"transparent"},"title":{"text":"Service Amount & Usage","font-color":"#FFFFFF","background-color":"#FFFFFF"},"legend":{"layout":"float","alpha":"0","shadow":false,"visible":true,"align":"center","vertical-align":"bottom"},"scale-x":{"max-labels":"5","zooming":false,"line-color":"#CFCFCF","labels":["07/21","08/21","09/21","10/21","11/21","12/21","01/22","02/22","03/22","04/22","05/22","06/22","07/22"],"font-angle":0,"item":{"font-family":"Open Sans"},"guide":{"alpha":0,"visible":true},"offset-end":"2px","offset-start":"2px","tick":{"alpha":0,"visible":false},"alpha":0,"items-overlap":false,"decimals":0,"font-color":"#646464","label":{"font-family":"Open Sans","font-color":"#646464"}},"scale-y":{"format":"$%v","zooming":false,"line-color":"#CFCFCF","font-angle":0,"guide":{"alpha":1,"line-color":"#CECECE","line-style":"solid","visible":false},"tick":{"alpha":0,"visible":false},"alpha":1,"items-overlap":false,"decimals":0,"font-color":"#646464","font-family":"Open Sans","label":{"font-family":"Open Sans","font-color":"#646464"}},"scale-y-2":{"zooming":false,"line-color":"transparent","font-angle":90,"guide":{"alpha":1,"line-color":"#CFCFCF","line-style":"solid","visible":true},"tick":{"alpha":0,"visible":false},"alpha":0,"items-overlap":false,"decimals":0,"font-color":"#646464","font-family":"Open Sans","label":{"font-family":"Open Sans","font-color":"#646464","font-angle":90,"html5-padding":"0 0 15px 0","text":"kWh"}},"type":"mixed","font-family":"Open Sans","series":[{"type":"bar","scales":"scale-x,scale-y","values":[530.38,1067.96,1382.02,1129.24,2115.17,3301.03,3854.34,4022.74,3374.57,3396.2,3235.49,3828.93,4255.55],"text":"Service Amount (Cost $)","font-family":"Open Sans","background-color":"#8bc38e","legend-item":{"visible":true},"url":"/Billing/MyPowerUsage?billCycle=%data-dateTime","data-dateTime":["07-21","08-21","09-21","10-21","11-21","12-21","01-22","02-22","03-22","04-22","05-22","06-22","07-22"],"tooltip":{"visible":true,"text":"$%v","decimals":2},"legend-marker":{"visible":true}},{"type":"area","scales":"scale-x,scale-y-2","values":[3440.0,7280.0,8160.0,5320.0,13120.0,31520.0,38480.0,42200.0,27600.0,28320.0,24920.0,29840.0,36520.0],"text":"Usage (kWh)","font-family":"Open Sans","gradient-colors":"#677DA5 transparent transparent","gradient-stops":"0.2 0.4 0.9","line-color":"#677DA5","border-color":"#677DA5","marker":{"type":"square","border-width":"0","shadow":false,"background-repeat":false,"background-color":"transparent"},"legend-item":{"visible":true},"line-width":"3px","data-dateTime":[],"legend-marker":{"background-image":"/images/ZingChart/legend-gradient-square.png","visible":true}}],"plot":{"stacked":false,"hover-state":{"visible":false}}}],"gui":{"behaviors":[{"id":"ShowAll","enabled":"none"},{"id":"ViewSource","enabled":"none"},{"id":"3D","enabled":"none"},{"id":"BugReport","enabled":"none"},{"id":"About","enabled":"none"},{"id":"FullScreen","enabled":"none"},{"id":"Print","enabled":"none"},{"id":"Reload","enabled":"none"},{"id":"LogScale","enabled":"none"},{"id":"SaveAsImage","enabled":"none"},{"id":"DownloadPDF","enabled":"none"},{"id":"DownloadSVG","enabled":"none"}],"context-menu[mobile]":{"button":{"visible":false,"background-color":"transparent","alpha":0,"border-radius":0},"gear":{"visible":false,"alpha":0}}}}',
        HighTempIndex: -1,
        LowTempIndex: -1,
        TemperatureIndex: -1,
        NotificationIndex: -1,
        AboveAlertIndex: -1,
        DailyAlertIndex: -1,
        WeekendIndex: -1,
        ReminderIndex: -1,
        ProjectedBillAmountHigh: null,
        ProjectedBillAmountLow: null,
        AverageDailyCost: null,
        Days: 0,
        DollarsToDate: null,
        TotalkWhUsed: 0,
        AverageDailyUsage: null,
        HasData: true,
        HasEstimatedBill: false,
        IsPartialMonth: false,
        RemainingDays: 0,
        DaysToDate: 0,
        AlertThreshold: 0,
        AlertThresholdExceeded: false,
        UsageTable: null
        },
        ModelErrors: [],
        IsScApiResult: true
    }
]

from southern-company-api.

apearson avatar apearson commented on July 18, 2024

@Ross-Rob can you check again without the changes I asked you to make? I can't see anything wrong with that reply and just want to make sure it's still an issue

from southern-company-api.

KeithMnemonic avatar KeithMnemonic commented on July 18, 2024

I just tested this and see the same results. I get the graph data but empty rows on these tests.

` ● grabs list of daily data

Returned an empty array

  31 |  	}
  32 |  	else if(data.length === 0){
> 33 |  		throw new Error('Returned an empty array');
     |  		      ^
  34 |  	}
  35 |  	else if(data.length !== 1){
  36 |  		throw new Error('Returned a larger than one array');

  at tests/data-single.test.ts:33:10
  at fulfilled (tests/data-single.test.ts:5:58)

● grabs list of monthly data

Returned an empty array

  47 | 	}
  48 | 	else if(data.length === 0){
> 49 | 		throw new Error('Returned an empty array');
     | 		      ^
  50 | 	}
  51 | 	else{
  52 | 		return;`

from southern-company-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.