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)
def _lightCount(s7conn, groupName): lights = light.loadGroup(s7conn, groupName) onCount = 0 for l in lights: if l.isOn(): onCount = onCount + 1 return onCount
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)