fronzbot / blinkpy Goto Github PK
View Code? Open in Web Editor NEWA Python library for the Blink Camera system
License: MIT License
A Python library for the Blink Camera system
License: MIT License
Should have way to refresh thumbnail image on a per camera basis
The tests are pretty messy and some are kludgy. All are poorly documented. Would like to clean these up and make sure each test serves a useful purpose.
Looking to speed up the process to update the cameras image when requesting and viewing in hass. Currently it takes around 60 or so seconds while the blink app itself is around 10. When looking at the home assistant blink.py it looks like the timedelta setting would change this. Except as included component I have not control. Thoughts?
Update blinkpy so that it supports Python 2.7 as well as 3+.
Describe the bug
When a re-authorization attempt happens, an error is logged saying.
ERROR Cannot connect to server with url <some url>
However, this section of the code should ALWAYS be hit when a token expires, so there really is no error.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
An error should only be logged if re-authorization hasn't even occurred yet. We should either change the log entry to INFO
or remove it and modify the actual error message with more detail. The offending line is line 62 of blinkpy.helpers.util
blinkpy
version: 0.10.2
Currently my cameras report terribly high values for temperature. By the looks of it, the JSON now returns fahrenheit instead of celcius ( ? ).
Attempting to view thumbnail of motion (replace .mp4 with .Jpg) is not working and returns code 700 (media not found). Normally this is accessed with
blink.cameras[name].motion['image']
Maybe a method needs to be added to convert the mp4 (which IS valid media) to a jpg (grab last frame)? Maybe there's a more appropriate way to request the image?
First of all: thanks a lot for the library! :)
Now my problem:
It seems like I had an issue where my camera was stuck in a reboot loop.
That seems to have created a good amount of events.
While in the ios app, I can see the videos recorded prior to that just fine.
When trying to access the events as such, I end up with 73 events:
for event in blink.events:
print(event)
But none of them actually include a video_url:
{'type': 'heartbeat', 'siren': None, 'id': 499313547, 'sync_module_id': yyyyyyy, 'camera': None, 'network_id': None, 'account_id': xxxxxxx, 'command_id': None, 'siren_id': None, 'camera_id': None, 'syncmodule': yyyyyyy, 'status': None, 'created_at': '2017-06-30T09:28:05+00:00', 'notified': False, 'account': xxxxxxx, 'duration': None, 'updated_at': '2017-06-30T09:28:05+00:00'}
{'type': 'first_boot', 'siren': None, 'id': 499313222, 'sync_module_id': yyyyyyy, 'camera': None, 'network_id': None, 'account_id': xxxxxxx, 'command_id': None, 'siren_id': None, 'camera_id': None, 'syncmodule': yyyyyyy, 'status': None, 'created_at': '2017-06-30T09:28:05+00:00', 'notified': False, 'account': xxxxxxx, 'duration': None, 'updated_at': '2017-06-30T09:28:05+00:00'}
{'type': 'heartbeat', 'siren': None, 'id': 499170781, 'sync_module_id': yyyyyyy, 'camera': None, 'network_id': None, 'account_id': xxxxxxx, 'command_id': None, 'siren_id': None, 'camera_id': None, 'syncmodule': yyyyyyy, 'status': None, 'created_at': '2017-06-30T09:24:40+00:00', 'notified': False, 'account': xxxxxxx, 'duration': None, 'updated_at': '2017-06-30T09:24:40+00:00'}
{'type': 'first_boot', 'siren': None, 'id': 499170389, 'sync_module_id': yyyyyyy, 'camera': None, 'network_id': None, 'account_id': xxxxxxx, 'command_id': None, 'siren_id': None, 'camera_id': None, 'syncmodule': yyyyyyy, 'status': None, 'created_at': '2017-06-30T09:24:40+00:00', 'notified': False, 'account': xxxxxxx, 'duration': None, 'updated_at': '2017-06-30T09:24:40+00:00'}
{'type': 'heartbeat', 'siren': None, 'id': 498834490, 'sync_module_id': yyyyyyy, 'camera': None, 'network_id': None, 'account_id': xxxxxxx, 'command_id': None, 'siren_id': None, 'camera_id': None, 'syncmodule': yyyyyyy, 'status': None, 'created_at': '2017-06-30T09:16:59+00:00', 'notified': False, 'account': xxxxxxx, 'duration': None, 'updated_at': '2017-06-30T09:16:59+00:00'}
{'type': 'first_boot', 'siren': None, 'id': 498834079, 'sync_module_id': yyyyyyy, 'camera': None, 'network_id': None, 'account_id': xxxxxxx, 'command_id': None, 'siren_id': None, 'camera_id': None, 'syncmodule': yyyyyyy, 'status': None, 'created_at': '2017-06-30T09:16:59+00:00', 'notified': False, 'account': xxxxxxx, 'duration': None, 'updated_at': '2017-06-30T09:16:59+00:00'}
{'type': 'heartbeat', 'siren': None, 'id': 498663526, 'sync_module_id': yyyyyyy, 'camera': None, 'network_id': None, 'account_id': xxxxxxx, 'command_id': None, 'siren_id': None, 'camera_id': None, 'syncmodule': yyyyyyy, 'status': None, 'created_at': '2017-06-30T09:15:14+00:00', 'notified': False, 'account': xxxxxxx, 'duration': None, 'updated_at': '2017-06-30T09:15:14+00:00'}
{'type': 'first_boot', 'siren': None, 'id': 498663414, 'sync_module_id': yyyyyyy, 'camera': None, 'network_id': None, 'account_id': xxxxxxx, 'command_id': None, 'siren_id': None, 'camera_id': None, 'syncmodule': yyyyyyy, 'status': None, 'created_at': '2017-06-30T09:15:14+00:00', 'notified': False, 'account': xxxxxxx, 'duration': None, 'updated_at': '2017-06-30T09:15:14+00:00'}
{'type': 'heartbeat', 'siren': None, 'id': 498568310, 'sync_module_id': yyyyyyy, 'camera': None, 'network_id': None, 'account_id': xxxxxxx, 'command_id': None, 'siren_id': None, 'camera_id': None, 'syncmodule': yyyyyyy, 'status': None, 'created_at': '2017-06-30T09:14:27+00:00', 'notified': False, 'account': xxxxxxx, 'duration': None, 'updated_at': '2017-06-30T09:14:27+00:00'}
{'type': 'first_boot', 'siren': None, 'id': 498568178, 'sync_module_id': yyyyyyy, 'camera': None, 'network_id': None, 'account_id': xxxxxxx, 'command_id': None, 'siren_id': None, 'camera_id': None, 'syncmodule': yyyyyyy, 'status': None, 'created_at': '2017-06-30T09:14:27+00:00', 'notified': False, 'account': xxxxxxx, 'duration': None, 'updated_at': '2017-06-30T09:14:27+00:00'}
{'type': 'heartbeat', 'siren': None, 'id': 498518072, 'sync_module_id': yyyyyyy, 'camera': None, 'network_id': None, 'account_id': xxxxxxx, 'command_id': None, 'siren_id': None, 'camera_id': None, 'syncmodule': yyyyyyy, 'status': None, 'created_at': '2017-06-30T09:13:50+00:00', 'notified': False, 'account': xxxxxxx, 'duration': None, 'updated_at': '2017-06-30T09:13:50+00:00'}
{'type': 'first_boot', 'siren': None, 'id': 498460369, 'sync_module_id': yyyyyyy, 'camera': None, 'network_id': None, 'account_id': xxxxxxx, 'command_id': None, 'siren_id': None, 'camera_id': None, 'syncmodule': yyyyyyy, 'status': None, 'created_at': '2017-06-30T08:15:16+00:00', 'notified': False, 'account': xxxxxxx, 'duration': None, 'updated_at': '2017-06-30T08:15:16+00:00'}
Is there an inherent limit to the events call? some sort of pagination that isn't handled?
Hey there,
As you probably know (edit: just read your readme and realised you built it for this! :) ) Home Assistant uses the blinkpy library for its blink integration.
The motion sensing (I.e notification count) seems to have stopped working - people think it might be because HA is using 0.6 instead of 0.8 on blinkpy.
Any chance you can shed some light on this? Would love to get it working again! :)
Describe the bug
When a camera has no saved videos on the server, we print a 'Warning' to the log. This really should be an 'Info' statement instead (line 165 of blinkpy.cameras
)
blinkpy
version: 0.10.0
Log Output/Additional Information
If using home-assistant, please paste the output of the log showing your error below. If not, please include any additional useful information.
2018-10-18 15:04:24 WARNING (SyncWorker_7) [blinkpy.camera] Could not extract clip info from camera Blink 3
Describe the bug
Blink camera temperatures are not accurately reflected in HA when you use the blink app to calibrate the temperature settings to the proper temperature.
To Reproduce
Expected behavior
When calibrating the temperature, they should be the same in HA vs Blink App
Home Assistant version (if applicable): 84.6
blinkpy
version (not needed if filling out Home Assistant version):
Log Output/Additional Information
No errors for blink are showing.
PASTE LOG OUTPUT HERE
Instead of needing to individual request attributes, add a callable dict that has every available attribute per camera.
Calling the service 'blink.save_video' does not result in a video being saved.
Here is the automation:
The automation triggers, but doesn't result in an mp4 video file in that directory. The directory is whitelisted and used for images from other cameras already.
The logbook states:
1:39 AM
office camera video has been triggered
But no video file appears, and no blink errors show up in the log file.
Is this working for anyone else?
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Home Assistant version (if applicable):
blinkpy
version (not needed if filling out Home Assistant version):
Log Output/Additional Information
If using home-assistant, please paste the output of the log showing your error below. If not, please include any additional useful information.
PASTE LOG OUTPUT HERE
$ /usr/bin/python3 ./my_blinky.py
ERROR:blinkpy:More than one unboarded network. Platform may not work as intended. Please open an issue on https://github.com/fronzbot/blinkpy
Error connecting camera
When a user has multiple systems on their account, the blinkpy module only grabs the last implemented system. This should be handled more intelligently.
Need to increase test coverage.
I'm geting URL errors whenever I try to login with either the 8.0 or the dev branch of blinkpy. Has there possibly been an API change?
Describe the solution you'd like
If an API request fails, we should only log that error ONCE rather than every single time. This means we should have a variable for each sync module and camera called available
which is set to False
upon a failure. Maybe it's sufficient to only handle this once in the blink
module itself? My only concern there is that we don't want to mark the whole system as unavailable if a single camera loses connection or something.
When arming and disarming the system, the sensor updates in home assistant. But when toggling the motion for a camera on and off it stays on. The only way to toggle the motion sensor off in the HASS ui is to disarm the system entirely. Where both are then disabled.
I updated to HASS 0.80 and everything seemed to work fine. A few restarts later and the camera refuses to function. I stripped down the config to just username and password and it still is unresponsive. Within HASS, the battery status is for the camera is displayed as -100.
The HASS log shows this:
Unexpected exception Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/homeassistant/components/websocket_api/decorators.py", line 16, in _handle_async_response await func(hass, connection, msg) File "/usr/local/lib/python3.6/site-packages/homeassistant/components/camera/__init__.py", line 462, in websocket_camera_thumbnail image = await async_get_image(hass, msg['entity_id']) File "/usr/local/lib/python3.6/site-packages/homeassistant/components/camera/__init__.py", line 93, in async_get_image image = await camera.async_camera_image() File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.6/site-packages/homeassistant/components/camera/blink.py", line 76, in camera_image return self._camera.image_from_cache.content AttributeError: 'NoneType' object has no attribute 'content'
and
Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 390, in start resp = await self._request_handler(request) File "/usr/local/lib/python3.6/site-packages/aiohttp/web_app.py", line 366, in _handle resp = await handler(request) File "/usr/local/lib/python3.6/site-packages/aiohttp/web_middlewares.py", line 106, in impl return await handler(request) File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/static.py", line 66, in staticresource_middleware return await handler(request) File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/real_ip.py", line 34, in real_ip_middleware return await handler(request) File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/ban.py", line 66, in ban_middleware return await handler(request) File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/auth.py", line 68, in auth_middleware return await handler(request) File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/real_ip.py", line 34, in real_ip_middleware return await handler(request) File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/ban.py", line 66, in ban_middleware return await handler(request) File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/auth.py", line 68, in auth_middleware return await handler(request) File "/usr/local/lib/python3.6/site-packages/homeassistant/components/http/view.py", line 113, in handle result = await result File "/usr/local/lib/python3.6/site-packages/homeassistant/components/camera/__init__.py", line 406, in get return await self.handle(request, camera) File "/usr/local/lib/python3.6/site-packages/homeassistant/components/camera/__init__.py", line 423, in handle image = await camera.async_camera_image() File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.6/site-packages/homeassistant/components/camera/blink.py", line 76, in camera_image return self._camera.image_from_cache.content AttributeError: 'NoneType' object has no attribute 'content'
Repeating every minute or so post startup.
Describe the bug
Typo in blinkpy.py
line 147
Expected behavior
Should read "onboarded" instead of "unboarded"
blinkpy
version: 0.10.1
Is your feature request related to a problem? Please describe.
Setting logger to debug doesn't provide much info currently, as there are only a handful of debug prints.
Describe the solution you'd like
We should add a debug write every time a link is called, so we know what the platform is actually doing. We should also remove the video page debug print since it spits out a ton of useless information.
Log Details (ERROR)
Sat Nov 10 2018 18:00:02 GMT-0800 (Pacific Standard Time)
Cannot obtain new token for server auth. Please report this issue on https://github.com/fronzbot/blinkpy
Found this in my Home Assistant Logs.
Currently the camera dictionary can be accessed with the camera name, but case matters. We should ignore case sensitivity here to make it less annoying to access.
Describe the bug
Currently, the blinkpy
library requests a region_id from Blink upon login, and uses this as the basis for all API calls. In the US, this endpoint begins with the rest.prod
subdomain, while in Europe it is usally rest.prde
. However, not all of the API endpoints in Europe use the rest.prde
subdomain, based on comments in the repo this library is based upon. This seems likely to be the root cause of homeassistant/homeassistant#18341.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
First, we need to figure out if there are any safe API endpoint subdomains, or if there's a way to retrieve the correct subdomain on a case-by-case basis. After that, it's just a matter of keeping track of the correct subdomain to use per API call.
Home Assistant version (if applicable): 0.81.0+
blinkpy
version: 0.10.1 (but all versions are affected)
Additional Information
If you are having this issue and are willing to help debug to find a solution, please repeat the following steps and report the response (you must have curl
installed on your system):
Step 1: Login
curl -H "Host: prod.immedia-semi.com" -H "Content-Type: application/json" --data-binary '{ "password" : "your blink password", "client_specifier" : "iPhone 9.2 | 2.2 | 222", "email" : "your blink login/email" }' --compressed https://rest.prod.immedia-semi.com/login
Take note of the authtoken that is printed to your terminal window (but do not share it). Please post the "region" dictionary (it should look like "region":{"prde":"Europe"}
or something like that). Also note the network id (4-5 characters, all numbers). Looks like the following:
"networks": {"1234":{"name":"somename", "onboarded":"True"}}
If you have multiple network ids, only record the one that also has "onboarded":"True"
Step 2: Try arming/disarming the system
Based on the linked home-assistant issue, this is one potential failure point for European-based API endpoints. To arm/disarm just replace the last work in the link in the following command with arm
or disarm
. To see if it worked, wait ten or more seconds and then open your Blink App on your phone.
curl -H "Host: prde.immedia-semi.com" -H "TOKEN_AUTH: authtoken from login" --data-binary --compressed https://rest.prde.immedia-semi.com/network/*network_id_from_previous_step*/arm
If this doesn't work (you should received a 101
Unauthorized
error), try the following:
prde
in the above command with prod
prde
in the above command with u002
prde
in the above command with piri
Those variation are to see if there is some consistently safe API endpoint and will help determine future debug steps.
Is your feature request related to a problem? Please describe.
The blink app has the ability to calibrate the temperature sensor and set temperature alerts.
Describe the solution you'd like
Having the ability to set alerts and monitor them (as well as calibrate the sensor) would be neat. I do not know the API endpoint to do that yet, though.
Entered all commands as listed in readme, but nothing printed out. I tried entering the wrong password and got error messages, but when I entered the right password, there was no information printed about any of my cameras. Any advice in troubleshooting? I'm using Windows 10. I've got Python 3.6.3. I installed blinkpy as you recommended. I could not successfully perform all the commands you recommended for developer install.
Camera class is pretty messy, should try and clean it up
Despite the last reorg, i think this code could use some more cleanup. I think have a main blink module with sub components for sync modules and then cameras underneath that makes sense. Basically, cameras belong to sync modules, and sync modules belong to the core Blinkpy class.
Also, things like info refresh should be performs within each camera/sync module. I think there are a lot of superfluous API calls that can be paired down substantially.
The reorg should help make multi-sync unit integration a lot easier #36
Is your feature request related to a problem? Please describe.
blinkpy
.Describe the solution you'd like
I am trying to get the updated version of blink.py to work in HASS, except after updating to 0.79.3 HASS still is using the old version. I removed my custom component copy of blink and commented it out then in again within the config YAML and restarted. The cameras show up and work except it is the old version as proved by the old camera naming scheme and the old snap picture service name. I checked the release notes and nothing was noted about a Blink update. But the Home Assistant GitHub shows the updated version, so I don't know if this is on my side or a HASS based issue.
My config is just
blink: username: [email protected] password: Blinkpassword
Are the api updated?
Could anyone help?
Thanks!
The results are as below:
{
"event": [
{
"id": xxxxx,
"created_at": "2017-12-28T22:02:53+00:00",
"updated_at": "2017-12-28T22:02:53+00:00",
"type": "armed",
"notified": false,
"duration": null,
"status": null,
"command_id": null,
"camera_id": null,
"siren_id": null,
"sync_module_id": xxxx,
"network_id": null,
"account_id": xxxxx,
"syncmodule": xxxxx,
"camera": null,
"siren": null,
"account": xxxxx
}
]
}
Based on #60 we should be able to report battery status as a percentage using the voltage. Looks like it's reported as an integer out of 180 (equivalent to 1.8V).
Does this library (or the API) support running multiple commands at the same time? I tried running the "request_new_video" command on two different cameras simultaneously, and got the error "Cannot obtain new token for server auth".
Currently we're using a summary page to update the sync module and camera status. We probably should be using the syncmodules
and cameras
urls instead as shown in #90 since the information is more relevant and likely easier to parse.
Hi!
I love the work on the blink4home camera. Also love the support in home-assistant! I had a custom component, but it did far less.
There is one thing. The url prod.immedia-semi.com doesn't work with my setup. Never has sadly. It seems that I can login, but any other action after that is blocked with the messge that I don't have authorisation.
After a bit of reverse engineering I found out that the app uses the following url:
https://rest.prir.immedia-semi.com
This works with my blink4home setup. Since it's used in the official app, it would be better to start using this (and also prevent others from having the same problem as me). The api on this url is the same as the one before.
Can you change/test this? Or do you want me to change it through a branch and send you a pull request?
Currently the Blink.login()
method only stores the username and password, which is kind of dumb. We should perform the authentication during this step instead, I think.
I'd like to make this API entirely async to improve home-assistant integration. In addition, I'd like to use the built-in 'async' keywords which would mean no more 3.4 support.
Based on this comment use ffmpeg to grab a frame of the most recently recorded clip and use that as a thumbnail.
My thought is to use this as the thumbnail by default, and have a separate attribute for still_image
. This way we can change the cached image based on whether snap_picture
was called (in which case we want to display the regular thumbnail rather than a frame from the clip).
Commands from linked post:
ffmpeg -y -ss 00:00:04 -i BlinkVideo.mp4 -vf 'crop=720:720:280:0' -vframes 1 -vcodec png BlinkImage.png
Breaking down the switches:
-y
Overwrite any existing file.-ss 00:00:04
Start at the 4th second of the video (in my setup the visitor is normally well in frame here).-i BlinkVideo.mp4
The input video.-vf βcrop=720:720:280:0β
Crop the image to 720px X 720px starting at 280 pixels from the left and 0 pixels from the top. This leaves me with a square image that I then display in HA Dashboard.-vframes 1
Only grab 1 frame for saving.-vcodec png
Save it as a PNG,BlinkImage.png
The output image file.Want to build in command-line support so to make this tool easier to use. Will likely require some code refactoring.
Describe the bug
If blinkpy
is unable to re-authorize with the Blink servers, it will log an error stating that fact. Any subsequent request will go through the same re-authorization attempt (which is fine) but will log the error again (which is NOT fine).
To Reproduce
Steps to reproduce the behavior (this should be implemented as a test):
blinkpy
attempts to re-authorize, replace with incorrect headers. An error is logged at this stage.Expected behavior
Upon the first failed re-authorization attempt, we should mark blinkpy
as unavailable
. This available
property should be added to the main Blink
class and initially set to False
. When we retrieve a valid token, we set this to True
. Upon a failed re-authorization attempt, Blink.available
should be set to False. Any subsequent request should check this variable prior to both the request and the logging of the error.
To summarize:
Blink.available
to False
upon a failed re-authorizationblinkpy
version: 0.10.2
prod.immedia-semi.com only works as host for US region. Need to get region at login to change immedia-semi.com subdomain.
For example, logging in with the following header:
headers = {'Host': 'prod.immedia-semi.com',
'Content-Type': 'application/json',
}
Results in the following json response:
{'region': {'prod': 'United States'},
'networks': {<REDACTED>: {'name': <REDACTED>, 'onboarded': True}},
'authtoken': {'message': 'auth', 'authtoken': <REDACTED>}}
Need to set subdomain:
(subdomain, region), = response.json()['region'].items()
Describe the bug
Backup login url in the helpers/constants.py
module contains errant /
instead of .
. Should be rest.piri.
instead of rest.piri/
To Reproduce
Steps to reproduce the behavior:
blinkpy
version: 0.11.0
Add tests to verify we can reauthorize and don't get stuck in loops if authorization not working
Change cameras function to return dict of cameras with name as key instead of the raw list
from blinkpy import blinkpy
blink = blinkpy.Blink(username='[email protected]', password='XXXX')
blink.start()
for name, camera in blink.sync.cameras.items():
print(name) # Name of the camera
print(camera.attributes) # Print available attributes of camera
This code doesn't show up any camera.
Cameras do show up in the app
Token expires after 24hrs. Would like to add in a feature where the token are handled behind the scenes in order to be backwards compatible with existing module that rely on blinkpy (such as the home assistant Blink module).
Perhaps when blinkpy calls the _request function we do a token check and grab a new one if the existing token has expired?
Add logging functionality
Describe the bug
Due to an addition to 0.10.0, I introduced a bug that prevents re-authorization. Blink will lose connection to the servers after a certain amount of time due to auth token expiry.
To Reproduce
Steps to reproduce the behavior:
events
retrieval when performing a system refresh.Expected behavior
When the first request fails, we should re-authorize and attempt again before throwing an error.
Home Assistant version (if applicable): 0.80.2
blinkpy
version (not needed if filling out Home Assistant version): 0.10.0
Log Output/Additional Information
2018-10-18 07:58:12 ERROR (SyncWorker_5) [blinkpy.helpers.util] Cannot connect to server. Possible outage.
2018-10-18 07:58:12 ERROR (MainThread) [homeassistant.helpers.entity] Update for alarm_control_panel.blink_sync fails
Traceback (most recent call last):
File "/usr/src/app/homeassistant/helpers/entity.py", line 221, in async_update_ha_state
await self.async_device_update()
File "/usr/src/app/homeassistant/helpers/entity.py", line 349, in async_device_update
await self.hass.async_add_job(self.update)
File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/app/homeassistant/components/alarm_control_panel/blink.py", line 77, in update
self.data.refresh()
File "/usr/local/lib/python3.6/site-packages/blinkpy/blinkpy.py", line 160, in refresh
self.sync.refresh(force_cache=force_cache)
File "/usr/local/lib/python3.6/site-packages/blinkpy/sync_module.py", line 114, in refresh
self.events = self.get_events()
File "/usr/local/lib/python3.6/site-packages/blinkpy/sync_module.py", line 105, in get_events
return response['event']
TypeError: 'NoneType' object is not subscriptable
The error exists on lines 49-53 of 'blinkpy.helpers.util`, copied below. When we hit the exception, we should retry before logging an error (instead of checking for retry in the code following the mentioned lines)
try:
response = blink.session.send(prepped, stream=stream)
except (exceptions.ConnectionError, exceptions.Timeout):
# CHECK IF RETRY HERE, IF NOT, PROCEED
_LOGGER.error("Cannot connect to server. Possible outage.")
return None
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.