Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix for Missing Temperature Readings and also a fix for pytest runs and for video streaming #13

Merged
merged 7 commits into from
May 6, 2022

Conversation

0bmay
Copy link
Collaborator

@0bmay 0bmay commented May 4, 2022

Not sure how data was returned in the past, but it appears that Canary has changed the number of records returned by Readings API URL or changed the sort order, but on April 30th, 2022 the temperature readings were no longer returned from the get_readings function.

Manually calling the API calls in PAW showed that the readings API call returns 20 records, with the first 12 being air_quality, the next 8 being humidity. Changing the created__range to 1 hour at 10 minute intervals returns 19 records( 1-6 being air quality, 7-12 humidity, 13-18 temperature and 19 being wifi) with all records listed in descending time.

Also fixed is running pytest after Katie made changes for fixing Live Streaming.

Home Assistant issue thread
Temperature is no longer being returned in the get_readings / get_latest_readings call

0bmay added 3 commits May 4, 2022 10:17
pytest now works with the changes to the live stream api changes
changes get_Readings range from 2 hours to 1. 

The resulting JSON from Canary lists 20 items, the first 12 are air quality, the next 8 are humidity. Temperature is not returned in the first 20 records. I don't know if Canary changed the order in which the data is returned (date-time vs sensor_type) but it appears to be sensor-type, then date desc.

This appears to be why temperature is missing. Changing the window of time to look at to 1 hour resulted in all three data types (air_quality, humidify and temperature) to be retuned in the Api.get_readings call.
looks like canary changed the file that sets the ssesyranac cookie from the login page to a manifest.json file linked off the login page.  Looking at all the files, that was the only file that set the ssesyranac cookie.
@0bmay
Copy link
Collaborator Author

0bmay commented May 5, 2022

get session cookies fix from above allows the library to load up a captured image in my testing...

@0bmay 0bmay changed the title fix: Fix for Missing Temperature Readings and also a fix for pytest runs fix: Fix for Missing Temperature Readings and also a fix for pytest runs and for video streaming May 5, 2022
0bmay and others added 4 commits May 5, 2022 10:34
- updates canary's user agent header app version and iOS version
- reformat code
- adds pre-commit (dev tool)
- adds pytest config data
drops the time range to get readings from 1 hour to 40 minutes.  This allows to get 5 different reading types instead of 4, due to the 20 record limit returned by canary's API call.  Current sensor types are air_quality, humidity, temperature, battery and wifi.
updates pre-commit to run pylint
adds pre-commit to requirements_tests.txt
@snjoetw snjoetw merged commit e9cfca6 into snjoetw:master May 6, 2022
@snjoetw
Copy link
Owner

snjoetw commented May 6, 2022

Awesome! Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants