def setUp(self): """Set up Blink module.""" self.blink = blinkpy.Blink(username=USERNAME, password=PASSWORD) (self.region_id, self.region), = mresp.LOGIN_RESPONSE['region'].items() self.test_urls = blinkpy.BlinkURLHandler(self.region_id) self.urls = self.test_urls
def update_snapshots(): global config blink = blinkpy.Blink(username=config['username'], password=config['password']) try: blink.setup_system() for camera in blink.cameras: try: blink.cameras[camera].snap_picture() except Exception as e: print(e) else: print("{} snapshot has been updated.".format(camera)) time.sleep(10) except Exception as e: print(e)
def __init__(self, config_info): """Initialize the system.""" import blinkpy self.blink = blinkpy.Blink(username=config_info[DOMAIN][CONF_USERNAME], password=config_info[DOMAIN][CONF_PASSWORD]) self.blink.setup_system()
import sqlite3 import datetime import configparser import blinkpy DATABASE = 'blinkui.db' DEBUG = True conf = configparser.ConfigParser() conf.read('blinkui.conf') BLINK_USERNAME = conf.get('blink', 'username') BLINK_PASSWORD = conf.get('blink', 'password') blink = blinkpy.Blink(username=BLINK_USERNAME, password=BLINK_PASSWORD) blink.setup_system() for name, camera in blink.cameras.items(): print(name) # Name of the camera print(camera.id) # Integer id of the camera (assigned by Blink) print(camera.armed ) # Whether the device is armed/disarmed (ie. detecting motion) print(camera.clip) # Link to last motion clip captured print(camera.thumbnail) # Link to current camera thumbnail print( camera.temperature ) # Current camera temperature (not super accurate, but might be useful for someone) print( camera.battery ) # Current battery level... I think the value ranges from 0-3, but not quite sure yet.
def setUp(self): """Set up Blink module.""" self.blink = blinkpy.Blink(username=USERNAME, password=PASSWORD)
def setup_blink(): blink = blinkpy.Blink(username=app.config['BLINK_USERNAME'], password=app.config['BLINK_PASSWORD']) blink.setup_system() return blink