angle += increment if angle > 360: angle = 0 if angle < 0: angle = 360 return angle def rotateAngle2(increment=1): global angle2 angle2 += increment if angle2 > 360: angle2 = 0 if angle2 < 0: angle2 = 360 return angle2 # set minimum image size - must be done asap hyperion.imageMinSize(64, 64) iW = hyperion.imageWidth() iH = hyperion.imageHeight() # Get the parameters rotationTime = float(hyperion.args.get('rotation-time', 10.0)) reverse = bool(hyperion.args.get('reverse', False)) centerX = float(hyperion.args.get('center_x', 0.5)) centerY = float(hyperion.args.get('center_y', 0.5)) randomCenter = bool(hyperion.args.get('random-center', False)) custColors = hyperion.args.get('custom-colors', ((255, 0, 0), (0, 255, 0), (0, 0, 255))) enableSecond = bool(hyperion.args.get('enable-second', False)) #rotationTime2 = float(hyperion.args.get('rotation-time2', 5.0)) reverse2 = bool(hyperion.args.get('reverse2', True))
import hyperion, time hyperion.imageMinSize(10, 10) iW = hyperion.imageWidth() iH = hyperion.imageHeight() countries = hyperion.args.get('countries', ("de", "at")) duration = int(hyperion.args.get('switch-time', 5)) imgIds = [] nr = 0 def switchImage(): global nr if nr >= len(imgIds): nr = 0 hyperion.imageShow(imgIds[nr]) nr += 1 def printFlag(country): # official country codes ############# # EU flags -> missing: cyprus, UK ############# # de flag (Germany) if country == "de": hyperion.imageSolidFill(0, 0, iW, int(iH * 0.33), 0, 0, 0) hyperion.imageSolidFill(0, int(iH * 0.33), iW, int(iH * 0.33), 221, 0, 0) hyperion.imageSolidFill(0, int(iH * 0.66), iW, iH, 255, 206, 0)
import hyperion, time hyperion.imageMinSize(10,10) iW = hyperion.imageWidth() iH = hyperion.imageHeight() countries = hyperion.args.get('countries', ("de","at")) duration = int(hyperion.args.get('switch-time', 5)) imgIds = [] nr = 0 def switchImage(): global nr if nr >= len(imgIds): nr = 0 hyperion.imageShow(imgIds[nr]) nr += 1 def printFlag(country): # official country codes ############# # EU flags -> missing: cyprus, UK ############# # de flag (Germany) if country == "de": hyperion.imageSolidFill(0, 0, iW, int(iH*0.33), 0, 0, 0) hyperion.imageSolidFill(0, int(iH*0.33), iW, int(iH*0.33), 221, 0, 0) hyperion.imageSolidFill(0, int(iH*0.66), iW, iH, 255, 206, 0) # at flag (Austria) if country == "at": hyperion.imageSolidFill(237, 41, 57)
import hyperion, time, datetime hyperion.imageMinSize(32,32) # Get the parameters showSec = bool(hyperion.args.get('show_seconds', True)) hC = hyperion.args.get('hour-color', (0,0,255)) mC = hyperion.args.get('minute-color', (0,255,0)) sC = hyperion.args.get('second-color', (255,0,0)) bgC = hyperion.args.get('background-color', (0,0,0)) markEnable = hyperion.args.get('marker-enabled', False) markD = int(hyperion.args.get('marker-depth', 5))/100.0 markW = int(hyperion.args.get('marker-width', 5))/100.0 markC = hyperion.args.get('marker-color', (255,255,255)) #calculate some stuff centerX = int(round(hyperion.imageWidth())/2) centerY = int(round(float(hyperion.imageHeight())/2)) markDepthX = int(round(hyperion.imageWidth()*markD)) markDepthY = int(round(hyperion.imageHeight()*markD)) markThick = int(round(hyperion.imageHeight()*markW)) colorsSecond = bytearray([ 0, sC[0],sC[1],sC[2],255, 8, sC[0],sC[1],sC[2],255, 10, 0,0,0,0, ]) colorsMinute = bytearray([ 0, mC[0],mC[1],mC[2],255,
def rotateAngle( increment = 1): global angle angle += increment if angle > 360: angle=0 if angle < 0: angle=360 return angle def rotateAngle2( increment = 1): global angle2 angle2 += increment if angle2 > 360: angle2=0 if angle2 < 0: angle2=360 return angle2 # set minimum image size - must be done asap hyperion.imageMinSize(64,64) iW = hyperion.imageWidth() iH = hyperion.imageHeight() # Get the parameters rotationTime = float(hyperion.args.get('rotation-time', 10.0)) reverse = bool(hyperion.args.get('reverse', False)) centerX = float(hyperion.args.get('center_x', 0.5)) centerY = float(hyperion.args.get('center_y', 0.5)) randomCenter = bool(hyperion.args.get('random-center', False)) custColors = hyperion.args.get('custom-colors', ((255,0,0),(0,255,0),(0,0,255))) enableSecond = bool(hyperion.args.get('enable-second', False)) #rotationTime2 = float(hyperion.args.get('rotation-time2', 5.0)) reverse2 = bool(hyperion.args.get('reverse2', True)) centerX2 = float(hyperion.args.get('center_x2', 0.5))