mirror of
				https://github.com/Tediore/battery2mqtt.git
				synced 2025-11-03 20:46:35 +01:00 
			
		
		
		
	Now with 30% less sugar
This commit is contained in:
		@@ -19,7 +19,11 @@ TIME_REMAINING = int(os.getenv('TIME_REMAINING', 1))
 | 
			
		||||
AC_ADAPTER = int(os.getenv('AC_ADAPTER', 0))
 | 
			
		||||
LOG_LEVEL = os.getenv('LOG_LEVEL', 'INFO').upper()
 | 
			
		||||
 | 
			
		||||
logging.basicConfig(level=LOG_LEVEL, format='%(asctime)s %(levelname)s: %(message)s')
 | 
			
		||||
if LOG_LEVEL.lower() not in ['debug', 'info', 'warning', 'error']:
 | 
			
		||||
    logging.basicConfig(level='INFO', format='%(asctime)s %(levelname)s: %(message)s')
 | 
			
		||||
    logging.warning(f'Selected log level "{LOG_LEVEL}" is not valid; using default')
 | 
			
		||||
else:
 | 
			
		||||
    logging.basicConfig(level=LOG_LEVEL, format='%(asctime)s %(levelname)s: %(message)s')
 | 
			
		||||
 | 
			
		||||
client = mqtt.Client("battery2mqtt")
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user