Ejemplo n.º 1
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from Blinker.Blinker import Blinker, BlinkerButton, BlinkerNumber, BlinkerDuerOS
from Blinker.BlinkerConfig import *
from Blinker.BlinkerDebug import *

auth = 'Your Device Secret Key'

BLINKER_DEBUG.debugAll()

Blinker.mode('BLINKER_WIFI')
Blinker.duerType('BLINKER_DUEROS_SENSOR')
Blinker.begin(auth)

button1 = BlinkerButton('btn-abc')
number1 = BlinkerNumber('num-abc')

counter = 0

def duerQuery(queryCode):
    ''' '''

    BLINKER_LOG('DuerOS Query codes: ', queryCode)

    if queryCode == BLINKER_CMD_QUERY_AQI_NUMBER :
        BLINKER_LOG("DuerOS Query AQI")
        BlinkerDuerOS.aqi(20)
        BlinkerDuerOS.print()
    elif queryCode == BLINKER_CMD_QUERY_CO2_NUMBER :
        BLINKER_LOG("DuerOS Query CO2")
Ejemplo n.º 2
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from Blinker.Blinker import Blinker, BlinkerButton, BlinkerNumber, BlinkerDuerOS
from Blinker.BlinkerConfig import *
from Blinker.BlinkerDebug import *

auth = 'Your Device Secret Key'

BLINKER_DEBUG.debugAll()

Blinker.mode('BLINKER_WIFI')
Blinker.duerType('BLINKER_DUEROS_OUTLET')
Blinker.begin(auth)

button1 = BlinkerButton('btn-abc')
number1 = BlinkerNumber('num-abc')

counter = 0
oState = 'on'


def duerPowerState(state):
    ''' '''

    BLINKER_LOG('need set power state: ', state)

    BlinkerDuerOS.powerState(state)
    BlinkerDuerOS.print()

Ejemplo n.º 3
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from Blinker.Blinker import Blinker, BlinkerButton, BlinkerNumber, BlinkerDuerOS
from Blinker.BlinkerConfig import *
from Blinker.BlinkerDebug import *

auth = 'Your Device Secret Key'

BLINKER_DEBUG.debugAll()

Blinker.mode('BLINKER_WIFI')
Blinker.duerType('BLINKER_DUEROS_LIGHT')
Blinker.begin(auth)

button1 = BlinkerButton('btn-abc')
number1 = BlinkerNumber('num-abc')

counter = 0
wsState = 'on'
wsMode = BLINKER_CMD_COMMON


def duerPowerState(state):
    ''' '''

    BLINKER_LOG('need set power state: ', state)

    BlinkerDuerOS.powerState(state)
    BlinkerDuerOS.print()