make DEBUG an environment variable
This commit is contained in:
		
							parent
							
								
									8b7312b6fc
								
							
						
					
					
						commit
						285af11af7
					
				
					 2 changed files with 6 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -7,7 +7,8 @@ The plan:
 | 
			
		|||
1. Use Fauxmo to create a virtual switch 'Movie Lights' recognized on the
 | 
			
		||||
   NAS at port 20000
 | 
			
		||||
2. Fauxmo will run in a docker file and be able to talk to another container,
 | 
			
		||||
   which runs our golang executable. Other container IP will be 172.31.0.243
 | 
			
		||||
   which runs our golang executable. Other container host will be movielights
 | 
			
		||||
   (added via add-host option)
 | 
			
		||||
3. Our golang executable will then talk to the actual wemo switches
 | 
			
		||||
 | 
			
		||||
TODO:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -31,6 +31,7 @@ import requests
 | 
			
		|||
import select
 | 
			
		||||
import socket
 | 
			
		||||
import struct
 | 
			
		||||
import os
 | 
			
		||||
import sys
 | 
			
		||||
import time
 | 
			
		||||
import uuid
 | 
			
		||||
| 
						 | 
				
			
			@ -52,7 +53,7 @@ SETUP_XML = """<?xml version="1.0"?>
 | 
			
		|||
"""
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
DEBUG = False
 | 
			
		||||
DEBUG = os.getenv("DEBUG", "FALSE") == "TRUE"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def dbg(msg):
 | 
			
		||||
| 
						 | 
				
			
			@ -384,8 +385,8 @@ FAUXMOS = [
 | 
			
		|||
    [
 | 
			
		||||
        'Movie Lights',
 | 
			
		||||
        rest_api_handler(
 | 
			
		||||
            'http://172.31.0.243:8081/basement?moviemode=true',
 | 
			
		||||
            'http://172.31.0.243:8081/basement?moviemode=false'
 | 
			
		||||
            'http://movielights:8081/basement?moviemode=true',
 | 
			
		||||
            'http://movielights:8081/basement?moviemode=false'
 | 
			
		||||
        ),
 | 
			
		||||
        20000
 | 
			
		||||
    ],
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue