Document setup

This commit is contained in:
Christian Colglazier 2023-08-05 10:31:43 -04:00
parent ec9a186b16
commit d23936faf7
2 changed files with 11 additions and 1 deletions

View File

@ -7,3 +7,13 @@ A custom DMX server that integrates with Home Assistant.
```sh
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.

View File

@ -22,7 +22,7 @@ config = configparser.ConfigParser()
config.sections()
programPath = os.path.dirname(os.path.realpath(__file__))
config.read('{}/settings.ini'.format(programPath))
URL = 'https://{}/api'.format(config['HomeAssistant']['url'])
URL = '{}/api'.format(config['HomeAssistant']['url'])
TOKEN = config['HomeAssistant']['token']
client = Client(URL, TOKEN)
light = client.get_domain('light')