Beispiel #1
0
def lightgroup(request, groupName):
    s7conn = getS7Conn()
    lights = light.loadGroup(s7conn, groupName)
    if lights is None:
        raise Http404

    context = {'tag': 'light', 'groupName': groupName, 'lights': lights}
    return render(request, "lights.html", context)
Beispiel #2
0
def _lightCount(s7conn, groupName):
    lights = light.loadGroup(s7conn, groupName)

    onCount = 0
    for l in lights:
        if l.isOn():
            onCount = onCount + 1

    return onCount
Beispiel #3
0
def _lightCount(s7conn, groupName):
    lights = light.loadGroup(s7conn, groupName)

    onCount = 0
    for l in lights:
        if l.isOn():
            onCount = onCount + 1

    return onCount
Beispiel #4
0
def lightgroup(request, groupName):
    s7conn = getS7Conn()
    lights = light.loadGroup(s7conn, groupName)
    if lights is None:
        raise Http404

    context = {
            'tag': 'light',
            'groupName': groupName,
            'lights' : lights
            }
    return render(request, "lights.html", context)