示例#1
0
def myQPoll():
    MyQ = DeviceComunication.MyQ()
    #MyQ.authenticate()
    myq_ids = HomerHelper.getIDofDeviceTypes("MyQ")
    for id in myq_ids:
        try:
            doorstatus = MyQ.getDoorStatus(id)
            HomerHelper.updateDeviceAttribute(id, doorstatus, 'State')
        except:
            MyQ.authenticate()
            MyQ.getDoorStatus(id)
            HomerHelper.updateDeviceAttribute(id, doorstatus, 'State')
示例#2
0
def HuePoll():
        hue_ids = HomerHelper.getIDofDeviceTypes("hue")
        for id in hue_ids:
            hue_brightness = DeviceComunication.getHueBrightness(id)
            HomerHelper.updateDeviceAttribute(id, hue_brightness, 'Brightness')