diff --git a/light8/ExternalInput.py b/light8/ExternalInput.py --- a/light8/ExternalInput.py +++ b/light8/ExternalInput.py @@ -7,7 +7,12 @@ currentlevels = [0,0,0,0] class NetSliderHandler(SocketServer.StreamRequestHandler): def handle(self): data = self.rfile.readline(1000) - currentlevels[:] = [float(x)/255 for x in list(data.split())] + currentlevels[:] = [round(self.bounds(float(x)/255),3) for x in list(data.split())] + def bounds(self,x): + # the last .1 both ways shall not do anything + x=x*1.1-.05 + x=min(1,max(0,x)) + return x def start_server(levelstorage=0): server = SocketServer.TCPServer(