예제 #1
0
def loadWPAutomation():
    automations = KnowledgeGraph.get_entities_by_type(DOME.Automation)
    if (len(automations) > 1):
        print('[TEST] No Automation created, already present')
        return False

    # Automation
    label = 'WPTestAutomation'
    trigger = test_create_trigger()
    action = [test_create_action()]
    automation = KnowledgeGraph.add_automation(label, trigger, action)
    return True
예제 #2
0
def test_create_condition():
    label = 'Regent het?'
    observes = 'http://kadjanderman.com/resource/property/web/26f41707-967f-4410-a1f9-a0afe163450d'
    tState = '69'
    return KnowledgeGraph.add_condition(label, observes, tState)
예제 #3
0
def test_create_trigger():
    cond = test_create_condition()
    return KnowledgeGraph.add_trigger(cond)
예제 #4
0
def test_create_action():
    label = 'zet de kamerlamp aan.'
    command = 'turn_on'
    actuates = 'http://kadjanderman.com/resource/property/211491e6-f2c4-4c94-b628-f55397983a23'
    return KnowledgeGraph.add_action(label, actuates, command)
예제 #5
0
def test_create_condition():
    label = 'is het bedlampje aan?'
    observes = 'http://kadjanderman.com/resource/property/3f5faa35-134c-4b2a-8f6a-d6fa4c485c52'
    tState = 'on'
    return KnowledgeGraph.add_condition(label, observes, tState)