Basic DMX settings printout on start
This commit is contained in:
		
							
								
								
									
										12
									
								
								aquadmx.py
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								aquadmx.py
									
									
									
									
									
								
							@@ -90,6 +90,10 @@ class DMXDevice(object):
 | 
				
			|||||||
    # Get the device ID for Home Assistant.
 | 
					    # Get the device ID for Home Assistant.
 | 
				
			||||||
    def getDeviceID(self):
 | 
					    def getDeviceID(self):
 | 
				
			||||||
        return self.deviceID
 | 
					        return self.deviceID
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # Print settings of the device.
 | 
				
			||||||
 | 
					    def print(self):
 | 
				
			||||||
 | 
					        print('{}: {}-{}'.format(self.deviceID, self.getStartChannel(), self.getEndChannel()))
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
# Data structure for a DMX Universe.
 | 
					# Data structure for a DMX Universe.
 | 
				
			||||||
class DMXUniverse(object):
 | 
					class DMXUniverse(object):
 | 
				
			||||||
@@ -125,6 +129,11 @@ class DMXUniverse(object):
 | 
				
			|||||||
                    l.append(d)
 | 
					                    l.append(d)
 | 
				
			||||||
        return set(l)
 | 
					        return set(l)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # Print DMX Universe settings.
 | 
				
			||||||
 | 
					    def print(self):
 | 
				
			||||||
 | 
					        for d in self.devices:
 | 
				
			||||||
 | 
					            d.print()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Configs
 | 
					# Configs
 | 
				
			||||||
config = configparser.ConfigParser()
 | 
					config = configparser.ConfigParser()
 | 
				
			||||||
config.sections()
 | 
					config.sections()
 | 
				
			||||||
@@ -154,6 +163,9 @@ u1_listener = server.register_listener(universe,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# Start server
 | 
					# Start server
 | 
				
			||||||
print('AquaDMX is listening')
 | 
					print('AquaDMX is listening')
 | 
				
			||||||
 | 
					print()
 | 
				
			||||||
 | 
					print('Home Assistant ID: DMX Channel Start-DMX Channel End')
 | 
				
			||||||
 | 
					u1.print()
 | 
				
			||||||
while True:
 | 
					while True:
 | 
				
			||||||
    time.sleep(1)
 | 
					    time.sleep(1)
 | 
				
			||||||
    pass
 | 
					    pass
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user