Document setup
This commit is contained in:
parent
ec9a186b16
commit
d23936faf7
10
README.md
10
README.md
@ -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.
|
||||
|
@ -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')
|
||||
|
Loading…
x
Reference in New Issue
Block a user