bugfix to v19 (#90)
* conversiont to python 3 Signed-off-by: Tommaso Morello tommaso.morello@gmail.com (github: mortommy) * docs updating * README.md changed to v18.08 * README.md changed to v18.08 * Fix multilanguage bugs 2 (#35) * bright bright command instead of brighten * italian translation added voc files for italian translation Signed-off-by: mortommy <tommaso.morello@gmail.com> * intensita instead of luminosita (#36) Signed-off-by: Tommaso Morello <tommaso.morello@gmail.com> (github: mortommy)Signed-off-by: mortommy <tommaso.morello@gmail.com> * conversiont to python 3 Signed-oof-by: Tommaso Morello tommaso.morello@gmail.com (github: mortommy) Signed-off-by: mortommy <tommaso.morello@gmail.com> * Update documentation links (#37) Signed-off-by: Wouter Born <eclipse@maindrain.net>Signed-off-by: mortommy <tommaso.morello@gmail.com> * docs updating Signed-off-by: mortommy <tommaso.morello@gmail.com> * add German (#46) added german translation Signed-off-by: mortommy <tommaso.morello@gmail.com> * German Translation (#42) Signed-off-by: mortommy <tommaso.morello@gmail.com> * Fixed typo (#48) * Fixed typo "Brigth -> Bright" * Fixed typo * Fixed typo Signed-off-by: mortommy <tommaso.morello@gmail.com> * Update dimmer_command.rx (#53) Signed-off-by: mortommy <tommaso.morello@gmail.com> * Update dimmer_command.rx (#52) This spelling error was identified by user **LeBelle** who has been undertaking German translations on Mycroft Translate. Raising PR on LeBelle's behalf. Signed-off-by: mortommy <tommaso.morello@gmail.com> * README.md changed to v18.08 Signed-off-by: mortommy <tommaso.morello@gmail.com> * README.md changed to v18.08 Signed-off-by: mortommy <tommaso.morello@gmail.com> * added "turn x on/off" as a command (#56) It feels more natural for me to say turn light on instead of turn on light x Signed-off-by: mortommy <tommaso.morello@gmail.com> * added spanish support. Signed-off-by: Tommaso Morello tommaso.morello@gmail.com (github: mortommy) Signed-off-by: mortommy <tommaso.morello@gmail.com> * Revert "Add spanish" * added spanish support. Signed-off-by: Tommaso Morello tommaso.morello@gmail.com (github: mortommy) * Revert "Add spanish" * added spanish support. Signed-off-by: Tommaso Morello tommaso.morello@gmail.com (github: mortommy) * added spanish support. Signed-off-by: Tommaso Morello tommaso.morello@gmail.com (github: mortommy) * Fix supported languages list Signed-off-by: Tommaso Morello <tommaso.morello@gmail.com> * Revert "Fix supported languages list" * Fix supported languages list Signed-off-by: Tommaso Morello <tommaso.morello@gmail.com> * Fix languages values Signed-off-by: Tommaso Morello <tommaso.morello@gmail.com> * tuning what status intent. switch to padatious Signed-off-by: Tommaso Morello <tommaso.morello@gmail.com> * Convert what_status intent to padatious. Apply review from Mycroft team. Add new files Signed-off-by: Tommaso Morello <tommaso.morello@gmail.com> * Bug fix Signed-off-by: Tommaso Morello <tommaso.morello@gmail.com> * Bug fix 2 Signed-off-by: Tommaso Morello <tommaso.morello@gmail.com> * Bug fix 3 Signed-off-by: Tommaso Morello <tommaso.morello@gmail.com> * Bug fix 4 Signed-off-by: Tommaso Morello <tommaso.morello@gmail.com> * dimmer command regex fix Signed-off-by: Tommaso Morello <tommaso.morello@gmail.com> * Bug fix V19 Signed-off-by: mortommy <tommaso.morello@gmail.com> Co-authored-by: Wouter Born <github@maindrain.net> Co-authored-by: Andreas Reinle <gras64@web.de> Co-authored-by: Sawyer McLane <samclane@gmail.com> Co-authored-by: Kathy Reid <kathy@kathyreid.id.au> Co-authored-by: Fabian Pflug <gumulka@users.noreply.github.com>pull/91/head
parent
f15b90c266
commit
6ed5b806ee
103
__init__.py
103
__init__.py
|
@ -122,38 +122,42 @@ class openHABSkill(MycroftSkill):
|
|||
self.targetTemperatureItemsDic = {}
|
||||
self.homekitHeatingCoolingModeDic = {}
|
||||
|
||||
requestUrl = self.url+"/items?recursive=false"
|
||||
if self.url == None:
|
||||
LOGGER.error("Configuration needed!")
|
||||
self.speak_dialog('ConfigurationNeeded')
|
||||
else:
|
||||
requestUrl = self.url+"/items?recursive=false"
|
||||
|
||||
try:
|
||||
req = requests.get(requestUrl, headers=self.polling_headers)
|
||||
if req.status_code == 200:
|
||||
json_response = req.json()
|
||||
for x in range(0,len(json_response)):
|
||||
if ("Lighting" in json_response[x]['tags']):
|
||||
self.lightingItemsDic.update({json_response[x]['name']: json_response[x]['label']})
|
||||
elif ("Switchable" in json_response[x]['tags']):
|
||||
self.switchableItemsDic.update({json_response[x]['name']: json_response[x]['label']})
|
||||
elif ("CurrentTemperature" in json_response[x]['tags']):
|
||||
self.currentTempItemsDic.update({json_response[x]['name']: json_response[x]['label']})
|
||||
elif ("CurrentHumidity" in json_response[x]['tags']):
|
||||
self.currentHumItemsDic.update({json_response[x]['name']: json_response[x]['label']})
|
||||
elif ("Thermostat" in json_response[x]['tags']):
|
||||
self.currentThermostatItemsDic.update({json_response[x]['name']: json_response[x]['label']})
|
||||
elif ("TargetTemperature" in json_response[x]['tags']):
|
||||
self.targetTemperatureItemsDic.update({json_response[x]['name']: json_response[x]['label']})
|
||||
elif ("homekit:HeatingCoolingMode" in json_response[x]['tags']):
|
||||
self.homekitHeatingCoolingModeDic.update({json_response[x]['name']: json_response[x]['label']})
|
||||
else:
|
||||
try:
|
||||
req = requests.get(requestUrl, headers=self.polling_headers)
|
||||
if req.status_code == 200:
|
||||
json_response = req.json()
|
||||
for x in range(0,len(json_response)):
|
||||
if ("Lighting" in json_response[x]['tags']):
|
||||
self.lightingItemsDic.update({json_response[x]['name']: json_response[x]['label']})
|
||||
elif ("Switchable" in json_response[x]['tags']):
|
||||
self.switchableItemsDic.update({json_response[x]['name']: json_response[x]['label']})
|
||||
elif ("CurrentTemperature" in json_response[x]['tags']):
|
||||
self.currentTempItemsDic.update({json_response[x]['name']: json_response[x]['label']})
|
||||
elif ("CurrentHumidity" in json_response[x]['tags']):
|
||||
self.currentHumItemsDic.update({json_response[x]['name']: json_response[x]['label']})
|
||||
elif ("Thermostat" in json_response[x]['tags']):
|
||||
self.currentThermostatItemsDic.update({json_response[x]['name']: json_response[x]['label']})
|
||||
elif ("TargetTemperature" in json_response[x]['tags']):
|
||||
self.targetTemperatureItemsDic.update({json_response[x]['name']: json_response[x]['label']})
|
||||
elif ("homekit:HeatingCoolingMode" in json_response[x]['tags']):
|
||||
self.homekitHeatingCoolingModeDic.update({json_response[x]['name']: json_response[x]['label']})
|
||||
else:
|
||||
pass
|
||||
else:
|
||||
LOGGER.error("Some issues with the command execution!")
|
||||
self.speak_dialog('GetItemsListError')
|
||||
|
||||
except KeyError:
|
||||
pass
|
||||
else:
|
||||
LOGGER.error("Some issues with the command execution!")
|
||||
self.speak_dialog('GetItemsListError')
|
||||
|
||||
except KeyError:
|
||||
pass
|
||||
except Exception:
|
||||
LOGGER.error("Some issues with the command execution!")
|
||||
self.speak_dialog('GetItemsListError')
|
||||
except Exception:
|
||||
LOGGER.error("Some issues with the command execution!")
|
||||
self.speak_dialog('GetItemsListError')
|
||||
|
||||
def findItemName(self, itemDictionary, messageItem):
|
||||
|
||||
|
@ -291,56 +295,19 @@ class openHABSkill(MycroftSkill):
|
|||
LOGGER.debug("Request Type: %s" % (requestType))
|
||||
|
||||
unitOfMeasure = self.translate('Degree')
|
||||
#unitOfMeasure = "degree"
|
||||
infoType = self.translate('Temperature')
|
||||
#infoType = "temperature"
|
||||
|
||||
# if (self.lang == "it-it"):
|
||||
# unitOfMeasure = "gradi"
|
||||
# infoType = "temperatura"
|
||||
|
||||
# if (self.lang == "de-de"):
|
||||
# unitOfMeasure = "Grad"
|
||||
# infoType = "Temperatur"
|
||||
|
||||
# if (self.lang == "es-es"):
|
||||
# unitOfMeasure = "grados"
|
||||
# infoType = "temperatura"
|
||||
|
||||
self.currStatusItemsDic = dict()
|
||||
|
||||
#if((requestType == "temperature") or (requestType == "la temperatura") or (requestType == "temperatur") or (requestType == "temperatura")):
|
||||
if self.voc_match(requestType, 'Temperature'):
|
||||
self.currStatusItemsDic.update(self.currentTempItemsDic)
|
||||
#elif((requestType == "humidity") or (requestType == "l'umidità") or (requestType == "Feuchtigkeit") or (requestType == "humedad")):
|
||||
elif self.voc_match(requestType, 'Humidity'):
|
||||
#unitOfMeasure = "percentage"
|
||||
unitOfMeasure = self.translate('Percentage')
|
||||
#infoType = "humidity"
|
||||
infoType = self.translate('Humidity')
|
||||
# if (self.lang == "it-it"):
|
||||
# unitOfMeasure = "percento"
|
||||
# infoType = "umidità"
|
||||
# if (self.lang == "de-de"):
|
||||
# unitOfMeasure = "Prozentsatz"
|
||||
# infoType = "Feuchtigkeit"
|
||||
# if (self.lang == "es-es"):
|
||||
# unitOfMeasure = "porciento"
|
||||
# infoType = "humedad"
|
||||
self.currStatusItemsDic.update(self.currentHumItemsDic)
|
||||
#elif((requestType == "status") or (requestType == "lo stato") or (requestType == "Status") or (requestType == "estado")):
|
||||
elif self.voc_match(requestType, 'Status'):
|
||||
#infoType = "status"
|
||||
infoType = self.translate('Status')
|
||||
unitOfMeasure = ""
|
||||
# if (self.lang == "it-it"):
|
||||
# unitOfMeasure = "stato"
|
||||
|
||||
# if (self.lang == "de-de"):
|
||||
# unitOfMeasure = "Status"
|
||||
|
||||
# if (self.lang == "es-es"):
|
||||
# unitOfMeasure = "estado"
|
||||
self.currStatusItemsDic.update(self.switchableItemsDic)
|
||||
else:
|
||||
self.currStatusItemsDic.update(self.targetTemperatureItemsDic)
|
||||
|
@ -365,14 +332,12 @@ class openHABSkill(MycroftSkill):
|
|||
ohItem = self.findItemName(self.targetTemperatureItemsDic, messageItem)
|
||||
|
||||
if ohItem != None:
|
||||
#if((command == "regulate") or (command == "adjust") or (command == "tune") or (command == "regola") or (command == "aggiusta") or (command == "metti") or (command == "reguliere") or (command == "stell") or (command == "pass") or (command == "regula") or (command == "ajusta") or (command == "afina")):
|
||||
if self.voc_match(command, 'Regulate'):
|
||||
statusCode = self.sendCommandToItem(ohItem, tempVal)
|
||||
newTempValue = tempVal
|
||||
else:
|
||||
state = self.getCurrentItemStatus(ohItem)
|
||||
if ((state != None) and (state.isdigit())):
|
||||
#if ((command == "increase") or (command == "incrementa") or (command == "erhöhe") or (command == "aumenta")):
|
||||
if self.voc_match(command, 'Increase'):
|
||||
newTempValue = int(state)+(int(tempVal))
|
||||
else:
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
(was ist|wie ist|worauf ist) (der|die|) {item} {requesttype}
|
||||
(was ist|wie ist|worauf ist) (der|die|) {requesttype} des {item}
|
||||
Sag mir (der|die|) {item} {requesttype}
|
||||
Sag mir (der|die|) {requesttype} des {item}
|
||||
Sag mir wie ist (der|die|) {item} {requesttype}
|
||||
Ich möchte wissen (der|die|) {item} {requesttype}
|
||||
Ich möchte wissen (der|die|) {requesttype} des {item}
|
||||
Ich möchte wissen wie ist (der|die|) {item} {requesttype}
|
||||
(was ist|wie ist|worauf ist) (der|die) {item} {requesttype}
|
||||
(was ist|wie ist|worauf ist) (der|die) {requesttype} des {item}
|
||||
Sag mir (der|die) {item} {requesttype}
|
||||
Sag mir (der|die) {requesttype} des {item}
|
||||
Sag mir wie ist (der|die) {item} {requesttype}
|
||||
Ich möchte wissen (der|die) {item} {requesttype}
|
||||
Ich möchte wissen (der|die) {requesttype} des {item}
|
||||
Ich möchte wissen wie ist (der|die) {item} {requesttype}
|
|
@ -1,9 +1,9 @@
|
|||
(what's|what is) (the|) {item} {requesttype}
|
||||
(what's|what is) (the|) {requesttype} of {item}
|
||||
how (the| ) {item} is {requesttype}
|
||||
tell me (the|) {item} {requesttype}
|
||||
tell me (the|) {requesttype} of {item}
|
||||
tell me how (the|) {item} is {requesttype}
|
||||
I'd like to know {item} {requesttype}
|
||||
I'd like to know (the|) {requesttype} of {item}
|
||||
I'd like to know how (the|) {item} is {requesttype}
|
||||
(what's|what is) the {item} {requesttype}
|
||||
(what's|what is) the {requesttype} of {item}
|
||||
how the {item} is {requesttype}
|
||||
tell me the {item} {requesttype}
|
||||
tell me the {requesttype} of {item}
|
||||
tell me how the {item} is {requesttype}
|
||||
I'd like to know the {item} {requesttype}
|
||||
I'd like to know the {requesttype} of {item}
|
||||
I'd like to know how the {item} is {requesttype}
|
|
@ -1,3 +1,3 @@
|
|||
(quale è|qual'è|com'è|come è) {requesttype} {item}
|
||||
vorrei sapere (quale è|qual'è|com'è|come è|) {requesttype} {item}
|
||||
dimmmi (quale è|qual'è|com'è|come è|) {requesttype} {item}
|
||||
(quale è|qual'è|com'è|come è) (la|lo|l'|) {requesttype} {item}
|
||||
vorrei sapere (quale è|qual'è|com'è|come è|) (la|lo|l'|) {requesttype} {item}
|
||||
dimmmi (quale è|qual'è|com'è|come è|) (la|lo|l'|) {requesttype} {item}
|
Reference in New Issue