Comments (8)
The data resets at midnight, maybe it works for you now?
You can dump it all to see with print(sense._trend_data["DAY"])
from sense.
Thanks for the reply! When I try that, I do get an output.
I am sure this is a problem with my understanding, however what I am looking to do is get usage data on a certain date. I see in the code it allows specifying a date, however I am unable to get anything to return.
`import datetime
from sense_energy import Senseable
sense = Senseable()
sense.authenticate('', '')
my_date = datetime.datetime(2023, 4, 2)
test = sense.get_trend_data('DAY',my_date)
print(test)`
and I get "None" as the output.
Thanks in advance!
from sense.
I am not able to get any data from sense.get_trend_data('DAY') even after running sense.update_trend_data()
from sense.
sense.get_trend_data
doesn't actually return the trend data; it just retrieves it and stores it in sense._trend_data
.
Based on the other get_
functions maybe it should return self._trend_data[scale]
? But it works to call and then read the result from self._trend_data[scale]
directly.
from sense.
Agree, the naming is inconsistent. Based on the other functions get_trend_data() should just do the api call and not change the internal _trend_data.
Instead, update_trend_data could have a scales=[] input parameter, or similar.
from sense.
I guess get_trend_data()
should really be an internal function or renamed to update_single_trend_data()
or something. The function get_trend()
should be used to retrieve trend data after it's been updated
from sense.
Renaming to update_single_trend_data()
would make sense. It would still be good to keep get_trend_data()
in line with all the other functions that just return the raw data from the API call.
Currently, it's quite mixed which functions return values AND modify internal data versus the ones that just return the raw data from the call (modifying internal data: get_trend_data(), get_discovered_device_names(), get_monitor_data()
). IMHO, it would be good to have a better separation in terms of naming between the functions that do an API call vs the ones that don't.
from sense.
The reason for that is the get_discovered_device_names()
and get_monitor_data()
are API calls that would likely be called only once per session while the ones like get_trend()
would return the data from the last time it was updated (which might happen once a minute or more). The get_trend()
could be called quite frequently while there's not much reason to call the others more than once
Renaming that function and a doc update would work here
from sense.
Related Issues (20)
- pip install sense_energy fails because it can't find README.md HOT 5
- Repeat print every 5 seconds HOT 6
- Error appearing with new websocket version HOT 2
- Can't run on python 2.7.6 HOT 3
- ModuleNotFoundError: No module named '__main__.sense_exceptions'; '__main__' is not a package HOT 5
- Websocket connection failure for realtime data HOT 4
- 'Senseable' object has no attribute 'rate_limit' HOT 4
- Question: Disconnect logs? HOT 2
- Timeouts - after 7pm every day?? HOT 3
- Allows passing in websession HOT 3
- MQTT support HOT 1
- Leg1 Leg2 Data for 400amp Split Systems - Wattage reading incorrect HOT 2
- Calling get_realtime() doesn't seem to update data without re-authentication
- get_all_usage_data for time period HOT 1
- Tag names are inconsistent HOT 1
- JSONDecodeError After One Hour HOT 10
- API works for an hour then fails HOT 1
- creating ssl context does blocking I/O
- Realtime device usage updates in HA HOT 4
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 sense.