Comments (5)
Also Output from command prompt
from southern-company-api.
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
southern-company-api/src/main.ts
Line 441 in 5ef4712
and put a console.log(resData
right above this line
southern-company-api/src/main.ts
Line 443 in 5ef4712
from southern-company-api.
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.
@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.
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)
- API returning back null data when last two days are requested HOT 3
- Move library to v1.0.0 HOT 2
- Tests are not checking validity of data
- Want to switch to node-fetch HOT 1
- Delayed Reading fix HOT 1
- Check if ending date is included or excluded from daily data HOT 1
- obtaining ScJwtToken HOT 8
- Getting 404 on MonthlyGraph API call HOT 4
- API change after 7/8? Null data json HOT 1
- Will this still work with Gulf Power Company even though they were sold to another company? HOT 2
- Does this still work? HOT 10
- SouthernCo just introduced Hourly Usage HOT 6
- 🐛 TypeError: Cannot read properties of undefined (reading '1') HOT 1
- Volunteering to help with GA power testing HOT 2
- Hourly API for premium subscription HOT 4
- Auth mechanism changed? HOT 5
- Usage no longer takes "AccountNumber" HOT 5
- Dates last year take this year's year
- GA Power Testing HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from southern-company-api.