Skip to content

Commit 6ea7d8f

Browse files
authored
Merge pull request #2 from RepositPower/feature/improve-docco
Fixes for documentation, tidying etc.
2 parents ca85c6d + 477bf40 commit 6ea7d8f

File tree

3 files changed

+25
-93
lines changed

3 files changed

+25
-93
lines changed

README.md

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
## Compatibility
1414

1515
- Python 2.7
16-
- Python 3+
17-
- Python 3.6 *preferred*
16+
- Python 3+ *preferred*
1817

1918
## Installation
2019
```
@@ -38,25 +37,21 @@ print(controller.battery_capacity)
3837
```
3938

4039
## Data
41-
| Method | Params | Description |
42-
|:-------------:|:-------------|:-------------|
43-
| `battery_capacity` | - | Get the capacity of the battery in kWh |
44-
| `battery_min_state_of_charge` | - | Get the minimum state of charge of the battery |
45-
| `has_battery` | - | Bool of whether the user has a battery or not|
46-
| `has_inverter` | - | Bool of whether the user has an inverter or not|
47-
| `get_historical_generation` | <ul><li>start (timestamp)</li><li>end(timestamp)(optional, default=now)</li></ul> | Get a list of generation data based on start or end|
48-
|`latest_historical_generation`|-|Get a list of the latest generation data. Goes back the last 24 hours.|
49-
| `get_historical_house` | <ul><li>start (timestamp)</li><li>end(timestamp)(optional, default=now)</li></ul> | Get a list of house data based on start or end|
50-
|`latest_historical_house`|-|Get a list of the latest house data. Goes back the last 24 hours.|
51-
| `get_historical_grid_credits` | <ul><li>start (timestamp)</li><li>end(timestamp)(optional, default=now)</li></ul> | Get a list of grid credits earned based on start or end|
52-
|`latest_historical_house`|-|Get a list of the latest grid credits earned. Goes back the last 24 hours.|
53-
| `get_historical_inverter` | <ul><li>start (timestamp)</li><li>end(timestamp)(optional, default=now)</li></ul> | Get a list of inverter data based on start or end|
54-
|`latest_historical_inverter`|-|Get a list of the latest inverter data. Goes back the last 24 hours.|
55-
| `get_historical_meter` | <ul><li>start (timestamp)</li><li>end(timestamp)(optional, default=now)</li></ul> | Get a list of meter data based on start or end|
56-
|`latest_historical_meter`|-|Get a list of the latest meter data. Goes back the last 24 hours.|
57-
|`weekday_tou_tariff`|-|Get weekday tou tariff information such as peak/off peak times and rates.|
58-
|`weekend_tou_tariff`|-|Get weekend tou tariff information such as peak/off peak times and rates.|
59-
|`feed_in_tariff`|-|Get the feed-in-tariff|
40+
| Method | Params | Description | Unit |
41+
|:-------------:|:-------------|:-------------|---------|
42+
| `battery_capacity` | - | Get the capacity of the battery | kWh |
43+
| `battery_min_state_of_charge` | - | Get the minimum state of charge of the battery | Percentage (%)
44+
| `has_battery` | - | Bool of whether the user has a battery or not| True/False |
45+
| `has_inverter` | - | Bool of whether the user has an inverter or not| True/False |
46+
| `get_solar_generation_data` | <ul><li>start (timestamp)</li><li>end(timestamp)(optional, default=now)</li></ul> | Get a list of solar generation data based on start or end| kW |
47+
|`latest_solar_generation_data`|-|Get a list of the latest generation data. Goes back the last 24 hours.| kW |
48+
| `get_house_data` | <ul><li>start (timestamp)</li><li>end(timestamp)(optional, default=now)</li></ul> | Get a list of house data based on start or end| kW|
49+
|`latest_house_data`|-|Get a list of the latest house data. Goes back the last 24 hours.| kW|
50+
| `get_battery_data` | <ul><li>start (timestamp)</li><li>end(timestamp)(optional, default=now)</li></ul> | Get a list of battery data based on start or end| kWh |
51+
|`latest_battery_data`|-|Get a list of the latest battery data. Goes back the last 24 hours.| kWh |pip
52+
| `get_meter_data` | <ul><li>start (timestamp)</li><li>end(timestamp)(optional, default=now)</li></ul> | Get a list of meter data based on start or end| kWh
53+
|`latest_meter_data`|-|Get a list of the latest meter data. Goes back the last 24 hours.| kWh |
54+
|`feed_in_tariff`|-|Get the feed-in-tariff| Dollars ($) |
6055

6156
## Links
6257

reposit/data/controller.py

Lines changed: 8 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def has_inverter(self):
8080
)
8181
return request.get()
8282

83-
def get_historical_generation(self, start, end):
83+
def get_solar_generation_data(self, start, end):
8484
"""
8585
Given a start and end timestamp return the generation
8686
data.
@@ -98,7 +98,7 @@ def get_historical_generation(self, start, end):
9898
return request.query(start, end)
9999

100100
@property
101-
def latest_historical_generation(self):
101+
def latest_solar_generation_data(self):
102102
"""
103103
Return a list of data points as lists. Time are in GMT
104104
:return:
@@ -112,7 +112,7 @@ def latest_historical_generation(self):
112112
)
113113
return request.get()
114114

115-
def get_historical_house(self, start, end):
115+
def get_house_data(self, start, end):
116116
"""
117117
Given a start and end timestamp return the house
118118
data.
@@ -130,7 +130,7 @@ def get_historical_house(self, start, end):
130130
return request.query(start, end)
131131

132132
@property
133-
def latest_historical_house(self):
133+
def latest_house_data(self):
134134
"""
135135
Return a list of data points as lists. Time are in GMT
136136
:return:
@@ -146,40 +146,7 @@ def latest_historical_house(self):
146146
)
147147
return request.get()
148148

149-
def get_historical_grid_credits(self, start, end):
150-
"""
151-
Given a start and end timestamp return the gridcredits
152-
data.
153-
:param start: unix timestamp
154-
:param end: unix timestamp
155-
:return: list of lists of data
156-
"""
157-
request = ApiRequest(
158-
path='v2/deployments/{}/gridcredits/historical'.format(self.user_key),
159-
controller=self,
160-
schema={
161-
'gridcredits': {}
162-
}
163-
)
164-
return request.query(start, end)
165-
166-
@property
167-
def latest_historical_grid_credits(self):
168-
"""
169-
Return a list of data points as lists. Times are in GMT
170-
:return:
171-
"""
172-
173-
request = ApiRequest(
174-
path='v2/deployments/{}/gridcredits/historical'.format(self.user_key),
175-
controller=self,
176-
schema={
177-
'gridcredits': {}
178-
}
179-
)
180-
return request.get()
181-
182-
def get_historical_inverter(self, start, end):
149+
def get_battery_data(self, start, end):
183150
"""
184151
Given a start and end timestamp return the inverter
185152
data.
@@ -197,7 +164,7 @@ def get_historical_inverter(self, start, end):
197164
return request.query(start, end)
198165

199166
@property
200-
def latest_historical_inverter(self):
167+
def latest_battery_data(self):
201168
"""
202169
Return a list of data points as lists. Times are in GMT
203170
:return:
@@ -211,7 +178,7 @@ def latest_historical_inverter(self):
211178
)
212179
return request.get()
213180

214-
def get_historical_meter(self, start, end):
181+
def get_meter_data(self, start, end):
215182
"""
216183
Given a start and end timestamp return the meter
217184
data.
@@ -229,7 +196,7 @@ def get_historical_meter(self, start, end):
229196
return request.query(start, end)
230197

231198
@property
232-
def latest_historical_meter(self):
199+
def latest_meter_data(self):
233200
"""
234201
Return a list of data points as lists. Times are in GMT
235202
:return:
@@ -243,36 +210,6 @@ def latest_historical_meter(self):
243210
)
244211
return request.get()
245212

246-
@property
247-
def weekday_tou_tariff(self):
248-
"""
249-
Returns a list of dicts of weekday time of use tariff information
250-
:return:
251-
"""
252-
request = ApiRequest(
253-
path='v2/deployments/{}/tariff/tou'.format(self.user_key),
254-
controller=self,
255-
schema={
256-
'weekday': {}
257-
}
258-
)
259-
return request.get()
260-
261-
@property
262-
def weekend_tou_tariff(self):
263-
"""
264-
Returns a list of dicts of weekend time of use tariff information
265-
:return:
266-
"""
267-
request = ApiRequest(
268-
path='v2/deployments/{}/tariff/tou'.format(self.user_key),
269-
controller=self,
270-
schema={
271-
'weekend': {}
272-
}
273-
)
274-
return request.get()
275-
276213
@property
277214
def feed_in_tariff(self):
278215
"""

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="reposit",
8-
version="0.3",
8+
version="0.3.1",
99
author="Thomas Basche",
1010
author_email="[email protected]",
1111
description="A library to communicate with a Reposit Controller",

0 commit comments

Comments
 (0)