@@ -73,70 +73,70 @@ async def set_active_session(self):
73
73
async def get_active_session (self ):
74
74
session = await self .auth .request ("get" , ElectricKiwiEndpoint .session )
75
75
check_status (session .status )
76
- Session .from_dict (await session .json ())
76
+ return Session .from_dict (await session .json ())
77
77
78
78
async def get_customer (self ):
79
79
customer = await self .auth .request ("get" ,
80
80
ElectricKiwiEndpoint .customer .format (customerNumber = self .customer_number ))
81
81
check_status (customer .status )
82
- Customer .from_dict (await customer .json ())
82
+ return Customer .from_dict (await customer .json ())
83
83
84
84
async def get_connection_details (self ):
85
85
connection_details = await self .auth .request ("get" , ElectricKiwiEndpoint .customerConnectionDetails .format (
86
86
customerNumber = self .customer_number ,
87
87
connectionId = self .connection_id ))
88
88
check_status (connection_details .status )
89
- CustomerConnection .from_dict (await connection_details .json ())
89
+ return CustomerConnection .from_dict (await connection_details .json ())
90
90
91
91
async def get_billing_address (self ):
92
92
billing_address = await self .auth .request ("get" ,
93
93
ElectricKiwiEndpoint .billingAddress .format (
94
94
customerNumber = self .customer_number ))
95
95
check_status (billing_address .status )
96
- BillingAddress .from_dict (await billing_address .json ())
96
+ return BillingAddress .from_dict (await billing_address .json ())
97
97
98
98
async def get_billing_frequency (self ):
99
99
billing_frequency = await self .auth .request ("get" , ElectricKiwiEndpoint .billingFrequency .format (
100
100
customerNumber = self .customer_number ))
101
101
check_status (billing_frequency .status )
102
- BillingFrequency .from_dict (await billing_frequency .json ())
102
+ return BillingFrequency .from_dict (await billing_frequency .json ())
103
103
104
104
# @paginated(by_query_params=get_next_page)
105
105
async def get_billing_bills (self , limit = 5 , offset = 0 ):
106
106
billing_bills = await self .auth .request ("get" , ElectricKiwiEndpoint .billingBills .format (customerNumber = self .customer_number , limit = limit , offset = offset ))
107
107
check_status (billing_bills .status )
108
- Bills .from_dict (await billing_bills .json ())
108
+ return Bills .from_dict (await billing_bills .json ())
109
109
110
110
async def get_billing_bill (self , bill_id ):
111
111
billing_bill = await self .auth .request ("get" ,
112
112
ElectricKiwiEndpoint .billingBill .format (
113
113
customerNumber = self .customer_number ,
114
114
billId = bill_id ))
115
115
check_status (billing_bill .status )
116
- Bill .from_dict (await billing_bill .json ())
116
+ return Bill .from_dict (await billing_bill .json ())
117
117
118
118
async def get_bill_file (self , bill_id ):
119
119
bill_file = await self .auth .request ("get" ,
120
120
ElectricKiwiEndpoint .billingBillFile .format (
121
121
customerNumber = self .customer_number ,
122
122
billId = bill_id ))
123
123
check_status (bill_file .status )
124
- BillFile .from_dict (await bill_file .json ())
124
+ return BillFile .from_dict (await bill_file .json ())
125
125
126
126
async def get_account_balance (self ):
127
127
account_balance = await self .auth .request ("get" ,
128
128
ElectricKiwiEndpoint .accountBalance .format (
129
129
customerNumber = self .customer_number ))
130
130
check_status (account_balance .status )
131
- AccountBalance .from_dict (await account_balance .json ())
131
+ return AccountBalance .from_dict (await account_balance .json ())
132
132
133
133
async def get_consumption_summary (self , start_date , end_date ):
134
134
consumption_summary = await self .auth .request ("get" , ElectricKiwiEndpoint .consumptionSummary .format (
135
135
customerNumber = self .customer_number ,
136
136
connectionId = self .connection_id ),
137
137
json = {start_date : start_date , end_date : end_date })
138
138
check_status (consumption_summary .status )
139
- ConsumptionSummary .from_dict (await consumption_summary .json ())
139
+ return ConsumptionSummary .from_dict (await consumption_summary .json ())
140
140
141
141
async def get_consumption_averages (self , start_date , end_date , group_by = "week" ):
142
142
consumption_average = await self .auth .request ("get" , ElectricKiwiEndpoint .consumptionAverages .format (
@@ -145,19 +145,19 @@ async def get_consumption_averages(self, start_date, end_date, group_by="week"):
145
145
json = {start_date : start_date , end_date : end_date ,
146
146
group_by : group_by })
147
147
check_status (consumption_average .status )
148
- ConsumptionAverage .from_dict (await consumption_average .json ())
148
+ return ConsumptionAverage .from_dict (await consumption_average .json ())
149
149
150
150
async def get_hop_intervals (self ):
151
151
hop_intervals = await self .auth .request ("get" , ElectricKiwiEndpoint .hourOfPowerIntervals )
152
152
check_status (hop_intervals .status )
153
- HopIntervals .from_dict (await hop_intervals .json ())
153
+ return HopIntervals .from_dict (await hop_intervals .json ())
154
154
155
155
async def get_hop (self ):
156
156
get_hop = await self .auth .request ("get" , ElectricKiwiEndpoint .hourOfPowerByConnection .format (
157
157
customerNumber = self .customer_number ,
158
158
connectionId = self .connection_id ))
159
159
check_status (get_hop .status )
160
- Hop .from_dict (await get_hop .json ())
160
+ return Hop .from_dict (await get_hop .json ())
161
161
162
162
async def post_hop (self , hop_interval ):
163
163
data = {"start" : hop_interval }
@@ -166,11 +166,11 @@ async def post_hop(self, hop_interval):
166
166
connectionId = self .connection_id ),
167
167
json = data )
168
168
check_status (post_hop .status )
169
- Hop .from_dict (await post_hop .json ())
169
+ return Hop .from_dict (await post_hop .json ())
170
170
171
171
async def get_outage_info (self ):
172
172
outage_info = await self .auth .request ("get" ,
173
173
ElectricKiwiEndpoint .outageContactInformationForConnection .format (
174
174
connectionId = self .connection_id ))
175
175
check_status (outage_info .status )
176
- OutageContact .from_dict (await outage_info .json ())
176
+ return OutageContact .from_dict (await outage_info .json ())
0 commit comments