Document setup
This commit is contained in:
		
							
								
								
									
										10
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								README.md
									
									
									
									
									
								
							| @@ -7,3 +7,13 @@ A custom DMX server that integrates with Home Assistant. | |||||||
| ```sh | ```sh | ||||||
| pip install -r requirements.txt | pip install -r requirements.txt | ||||||
| ``` | ``` | ||||||
|  | Create a `settings.ini` file with the following settings filled in: | ||||||
|  |  | ||||||
|  | ``` | ||||||
|  | [HomeAssistant] | ||||||
|  | url= | ||||||
|  | token= | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | url is the address of the Home Assistant instance with http or https. | ||||||
|  | token is the Long-Lived Access Token for Home Assistant. It can be obtained by going to the Home Assistant profile page and scrolling to the Long-Lived Access Tokens section and click Create Token. Give the token a name and click OK. Copy the token. | ||||||
|   | |||||||
| @@ -22,7 +22,7 @@ config = configparser.ConfigParser() | |||||||
| config.sections() | config.sections() | ||||||
| programPath = os.path.dirname(os.path.realpath(__file__)) | programPath = os.path.dirname(os.path.realpath(__file__)) | ||||||
| config.read('{}/settings.ini'.format(programPath)) | config.read('{}/settings.ini'.format(programPath)) | ||||||
| URL = 'https://{}/api'.format(config['HomeAssistant']['url']) | URL = '{}/api'.format(config['HomeAssistant']['url']) | ||||||
| TOKEN = config['HomeAssistant']['token'] | TOKEN = config['HomeAssistant']['token'] | ||||||
| client = Client(URL, TOKEN) | client = Client(URL, TOKEN) | ||||||
| light = client.get_domain('light') | light = client.get_domain('light') | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user