python-mytnb 0.5.0__tar.gz → 0.5.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_mytnb-0.5.0 → python_mytnb-0.5.1}/PKG-INFO +1 -1
- {python_mytnb-0.5.0 → python_mytnb-0.5.1}/pyproject.toml +1 -1
- {python_mytnb-0.5.0 → python_mytnb-0.5.1}/src/mytnb/models.py +7 -0
- {python_mytnb-0.5.0 → python_mytnb-0.5.1}/tests/test_models.py +6 -0
- {python_mytnb-0.5.0 → python_mytnb-0.5.1}/.github/workflows/ci.yml +0 -0
- {python_mytnb-0.5.0 → python_mytnb-0.5.1}/.github/workflows/publish.yml +0 -0
- {python_mytnb-0.5.0 → python_mytnb-0.5.1}/.gitignore +0 -0
- {python_mytnb-0.5.0 → python_mytnb-0.5.1}/LICENSE +0 -0
- {python_mytnb-0.5.0 → python_mytnb-0.5.1}/README.md +0 -0
- {python_mytnb-0.5.0 → python_mytnb-0.5.1}/src/mytnb/__init__.py +0 -0
- {python_mytnb-0.5.0 → python_mytnb-0.5.1}/src/mytnb/__main__.py +0 -0
- {python_mytnb-0.5.0 → python_mytnb-0.5.1}/src/mytnb/auth.py +0 -0
- {python_mytnb-0.5.0 → python_mytnb-0.5.1}/src/mytnb/cli.py +0 -0
- {python_mytnb-0.5.0 → python_mytnb-0.5.1}/src/mytnb/client/__init__.py +0 -0
- {python_mytnb-0.5.0 → python_mytnb-0.5.1}/src/mytnb/client/auth.py +0 -0
- {python_mytnb-0.5.0 → python_mytnb-0.5.1}/src/mytnb/client/client.py +0 -0
- {python_mytnb-0.5.0 → python_mytnb-0.5.1}/src/mytnb/client/config.py +0 -0
- {python_mytnb-0.5.0 → python_mytnb-0.5.1}/src/mytnb/client/legacy.py +0 -0
- {python_mytnb-0.5.0 → python_mytnb-0.5.1}/src/mytnb/client/rest.py +0 -0
- {python_mytnb-0.5.0 → python_mytnb-0.5.1}/src/mytnb/crypto.py +0 -0
- {python_mytnb-0.5.0 → python_mytnb-0.5.1}/src/mytnb/exceptions.py +0 -0
- {python_mytnb-0.5.0 → python_mytnb-0.5.1}/tests/test_auth.py +0 -0
- {python_mytnb-0.5.0 → python_mytnb-0.5.1}/tests/test_cli.py +0 -0
- {python_mytnb-0.5.0 → python_mytnb-0.5.1}/tests/test_client.py +0 -0
- {python_mytnb-0.5.0 → python_mytnb-0.5.1}/tests/test_crypto.py +0 -0
- {python_mytnb-0.5.0 → python_mytnb-0.5.1}/uv.lock +0 -0
|
@@ -267,6 +267,13 @@ class AccountUsage(BaseModel):
|
|
|
267
267
|
return m.numeric_value
|
|
268
268
|
return None
|
|
269
269
|
|
|
270
|
+
@property
|
|
271
|
+
def average_usage_kwh(self) -> Optional[float]:
|
|
272
|
+
for m in self.usage_metrics:
|
|
273
|
+
if m.key == "AVGUSAGE":
|
|
274
|
+
return m.numeric_value
|
|
275
|
+
return None
|
|
276
|
+
|
|
270
277
|
@property
|
|
271
278
|
def current_cost_rm(self) -> Optional[float]:
|
|
272
279
|
for m in self.cost_metrics:
|
|
@@ -244,6 +244,10 @@ class TestAccountUsage:
|
|
|
244
244
|
usage = AccountUsage.from_api_response(FULL_API_RESPONSE)
|
|
245
245
|
assert usage.current_usage_kwh == 234.5
|
|
246
246
|
|
|
247
|
+
def test_average_usage_kwh(self):
|
|
248
|
+
usage = AccountUsage.from_api_response(FULL_API_RESPONSE)
|
|
249
|
+
assert usage.average_usage_kwh == 15.6
|
|
250
|
+
|
|
247
251
|
def test_current_cost_rm(self):
|
|
248
252
|
usage = AccountUsage.from_api_response(FULL_API_RESPONSE)
|
|
249
253
|
assert usage.current_cost_rm == 87.60
|
|
@@ -280,6 +284,7 @@ class TestAccountUsage:
|
|
|
280
284
|
def test_empty_response(self):
|
|
281
285
|
usage = AccountUsage.from_api_response({})
|
|
282
286
|
assert usage.current_usage_kwh is None
|
|
287
|
+
assert usage.average_usage_kwh is None
|
|
283
288
|
assert usage.current_cost_rm is None
|
|
284
289
|
assert usage.projected_cost_rm is None
|
|
285
290
|
assert usage.by_month is None
|
|
@@ -291,6 +296,7 @@ class TestAccountUsage:
|
|
|
291
296
|
}
|
|
292
297
|
usage = AccountUsage.from_api_response(data)
|
|
293
298
|
assert usage.current_usage_kwh is None
|
|
299
|
+
assert usage.average_usage_kwh is None
|
|
294
300
|
assert usage.current_cost_rm is None
|
|
295
301
|
|
|
296
302
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|