-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose more SenseableBase properties. (#47)
* Refactor get_trend(). In order to expose additional properties, refactored get_trend() to required more than two keys from self._trend_data. * 'key' is now a keyword argument get_trend() with a default of "consumption", no longer is set as a boolean inside the function. * Perform type check on data references by key, ensure type is dict (for consumption/production), float (for new to/from_grid and net_production properties), or int (for production_pct). * Updated and expanded base properties. In order to expose additional information to be used with the new Home Assistant Energy dashboard, the following changes were made. * Converted existing True/False paramters on self.get_trend() calls to explicit key names. * Added new properties exposing existing information already in self._trend_data for daily and above. - production_pct - net_production - from_grid - to_grid * Also chomped some whitespace, because why not. * Update setup.py * Add solar_powered property. Reports as a percentage value in trend data. * Remove uncessary roll ups in get_trend. Aggregate values are already present in self._trend_data. Use of roll ups here seem to be causing the numbers to skew high. Removing it makes them match the Sense app. * Set version. * Remove default from key param. * Fix zero number for usage counter. Recent refactor of get_trend() results in instances of zero for the scale usage sensors in Home Assistant. Commit pulls data for concumption from Sense when Home Assistant requests usage. * 0.9.1 release
- Loading branch information
Showing
3 changed files
with
109 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,14 +12,14 @@ | |
'websockets;python_version>="3.5"', | ||
'aiohttp;python_version>="3.5"', | ||
], | ||
version = '0.9.0', | ||
version = '0.9.1', | ||
description = 'API for the Sense Energy Monitor', | ||
long_description=long_description, | ||
long_description_content_type="text/markdown", | ||
author = 'scottbonline', | ||
author_email = '[email protected]', | ||
url = 'https://github.com/scottbonline/sense', | ||
download_url = 'https://github.com/scottbonline/sense/archive/0.9.0.tar.gz', | ||
download_url = 'https://github.com/scottbonline/sense/archive/0.9.1.tar.gz', | ||
keywords = ['sense', 'energy', 'api', 'pytest'], | ||
classifiers = [ | ||
'Programming Language :: Python :: 2', | ||
|