change to using skill settings instead of old config (#72)

Signed-off-by: Håvard Moen <post@haavard.name>
pull/73/head
Håvard Moen 2019-10-07 17:24:11 +02:00 committed by mortommy
parent 965067e1b9
commit a09bf3b1ee
3 changed files with 14 additions and 15 deletions

View File

@ -64,19 +64,6 @@ cd skill-openhab
pip install -r requirements.txt
```
### Configuration
Add the block below to your `mycroft.conf` file:
```json
"openHABSkill": {
"host": "openHAB server ip",
"port": "openHAB server port"
}
```
Restart mycroft for the changes to take effect.
## Examples
* " Hey Mycroft, turn on Diningroom Light"
* "Hey Mycroft, switch off Kitchen Light"
@ -106,4 +93,4 @@ Restart mycroft for the changes to take effect.
#smarthome
#IoT
#Automation
#opensource
#opensource

View File

@ -48,7 +48,7 @@ class openHABSkill(MycroftSkill):
def __init__(self):
super(openHABSkill, self).__init__(name="openHABSkill")
self.url = "http://%s:%s/rest" % (self.config.get('host'), self.config.get('port'))
self.url = "http://%s:%s/rest" % (self.settings.get('host'), self.settings.get('port'))
self.command_headers = {"Content-type": "text/plain"}

12
settingsmeta.yaml Normal file
View File

@ -0,0 +1,12 @@
name: openHAB
skillMetadata:
sections:
- name: Connection
fields:
- name: host
label: openHAB server IP
type: text
- name: port
label: openHAB server port
type: number
value: 8080