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
mortommy 2020-04-07 16:09:14 +02:00 committed by GitHub
parent f15b90c266
commit 6ed5b806ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 417 additions and 452 deletions

View File

@ -122,38 +122,42 @@ class openHABSkill(MycroftSkill):
self.targetTemperatureItemsDic = {} self.targetTemperatureItemsDic = {}
self.homekitHeatingCoolingModeDic = {} 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: try:
req = requests.get(requestUrl, headers=self.polling_headers) req = requests.get(requestUrl, headers=self.polling_headers)
if req.status_code == 200: if req.status_code == 200:
json_response = req.json() json_response = req.json()
for x in range(0,len(json_response)): for x in range(0,len(json_response)):
if ("Lighting" in json_response[x]['tags']): if ("Lighting" in json_response[x]['tags']):
self.lightingItemsDic.update({json_response[x]['name']: json_response[x]['label']}) self.lightingItemsDic.update({json_response[x]['name']: json_response[x]['label']})
elif ("Switchable" in json_response[x]['tags']): elif ("Switchable" in json_response[x]['tags']):
self.switchableItemsDic.update({json_response[x]['name']: json_response[x]['label']}) self.switchableItemsDic.update({json_response[x]['name']: json_response[x]['label']})
elif ("CurrentTemperature" in json_response[x]['tags']): elif ("CurrentTemperature" in json_response[x]['tags']):
self.currentTempItemsDic.update({json_response[x]['name']: json_response[x]['label']}) self.currentTempItemsDic.update({json_response[x]['name']: json_response[x]['label']})
elif ("CurrentHumidity" in json_response[x]['tags']): elif ("CurrentHumidity" in json_response[x]['tags']):
self.currentHumItemsDic.update({json_response[x]['name']: json_response[x]['label']}) self.currentHumItemsDic.update({json_response[x]['name']: json_response[x]['label']})
elif ("Thermostat" in json_response[x]['tags']): elif ("Thermostat" in json_response[x]['tags']):
self.currentThermostatItemsDic.update({json_response[x]['name']: json_response[x]['label']}) self.currentThermostatItemsDic.update({json_response[x]['name']: json_response[x]['label']})
elif ("TargetTemperature" in json_response[x]['tags']): elif ("TargetTemperature" in json_response[x]['tags']):
self.targetTemperatureItemsDic.update({json_response[x]['name']: json_response[x]['label']}) self.targetTemperatureItemsDic.update({json_response[x]['name']: json_response[x]['label']})
elif ("homekit:HeatingCoolingMode" in json_response[x]['tags']): elif ("homekit:HeatingCoolingMode" in json_response[x]['tags']):
self.homekitHeatingCoolingModeDic.update({json_response[x]['name']: json_response[x]['label']}) self.homekitHeatingCoolingModeDic.update({json_response[x]['name']: json_response[x]['label']})
else: else:
pass
else:
LOGGER.error("Some issues with the command execution!")
self.speak_dialog('GetItemsListError')
except KeyError:
pass pass
else: except Exception:
LOGGER.error("Some issues with the command execution!") LOGGER.error("Some issues with the command execution!")
self.speak_dialog('GetItemsListError') self.speak_dialog('GetItemsListError')
except KeyError:
pass
except Exception:
LOGGER.error("Some issues with the command execution!")
self.speak_dialog('GetItemsListError')
def findItemName(self, itemDictionary, messageItem): def findItemName(self, itemDictionary, messageItem):
@ -291,56 +295,19 @@ class openHABSkill(MycroftSkill):
LOGGER.debug("Request Type: %s" % (requestType)) LOGGER.debug("Request Type: %s" % (requestType))
unitOfMeasure = self.translate('Degree') unitOfMeasure = self.translate('Degree')
#unitOfMeasure = "degree"
infoType = self.translate('Temperature') 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() self.currStatusItemsDic = dict()
#if((requestType == "temperature") or (requestType == "la temperatura") or (requestType == "temperatur") or (requestType == "temperatura")):
if self.voc_match(requestType, 'Temperature'): if self.voc_match(requestType, 'Temperature'):
self.currStatusItemsDic.update(self.currentTempItemsDic) self.currStatusItemsDic.update(self.currentTempItemsDic)
#elif((requestType == "humidity") or (requestType == "l'umidità") or (requestType == "Feuchtigkeit") or (requestType == "humedad")):
elif self.voc_match(requestType, 'Humidity'): elif self.voc_match(requestType, 'Humidity'):
#unitOfMeasure = "percentage"
unitOfMeasure = self.translate('Percentage') unitOfMeasure = self.translate('Percentage')
#infoType = "humidity"
infoType = self.translate('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) self.currStatusItemsDic.update(self.currentHumItemsDic)
#elif((requestType == "status") or (requestType == "lo stato") or (requestType == "Status") or (requestType == "estado")):
elif self.voc_match(requestType, 'Status'): elif self.voc_match(requestType, 'Status'):
#infoType = "status"
infoType = self.translate('Status') infoType = self.translate('Status')
unitOfMeasure = "" 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) self.currStatusItemsDic.update(self.switchableItemsDic)
else: else:
self.currStatusItemsDic.update(self.targetTemperatureItemsDic) self.currStatusItemsDic.update(self.targetTemperatureItemsDic)
@ -365,14 +332,12 @@ class openHABSkill(MycroftSkill):
ohItem = self.findItemName(self.targetTemperatureItemsDic, messageItem) ohItem = self.findItemName(self.targetTemperatureItemsDic, messageItem)
if ohItem != None: 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'): if self.voc_match(command, 'Regulate'):
statusCode = self.sendCommandToItem(ohItem, tempVal) statusCode = self.sendCommandToItem(ohItem, tempVal)
newTempValue = tempVal newTempValue = tempVal
else: else:
state = self.getCurrentItemStatus(ohItem) state = self.getCurrentItemStatus(ohItem)
if ((state != None) and (state.isdigit())): 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'): if self.voc_match(command, 'Increase'):
newTempValue = int(state)+(int(tempVal)) newTempValue = int(state)+(int(tempVal))
else: else:

View File

@ -1,8 +1,8 @@
(was ist|wie ist|worauf 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} (was ist|wie ist|worauf ist) (der|die) {requesttype} des {item}
Sag mir (der|die|) {item} {requesttype} Sag mir (der|die) {item} {requesttype}
Sag mir (der|die|) {requesttype} des {item} Sag mir (der|die) {requesttype} des {item}
Sag mir wie ist (der|die|) {item} {requesttype} Sag mir wie ist (der|die) {item} {requesttype}
Ich möchte wissen (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 (der|die) {requesttype} des {item}
Ich möchte wissen wie ist (der|die|) {item} {requesttype} Ich möchte wissen wie ist (der|die) {item} {requesttype}

View File

@ -1,9 +1,9 @@
(what's|what is) (the|) {item} {requesttype} (what's|what is) the {item} {requesttype}
(what's|what is) (the|) {requesttype} of {item} (what's|what is) the {requesttype} of {item}
how (the| ) {item} is {requesttype} how the {item} is {requesttype}
tell me (the|) {item} {requesttype} tell me the {item} {requesttype}
tell me (the|) {requesttype} of {item} tell me the {requesttype} of {item}
tell me how (the|) {item} is {requesttype} tell me how the {item} is {requesttype}
I'd like to know {item} {requesttype} I'd like to know the {item} {requesttype}
I'd like to know (the|) {requesttype} of {item} I'd like to know the {requesttype} of {item}
I'd like to know how (the|) {item} is {requesttype} I'd like to know how the {item} is {requesttype}

View File

@ -1,3 +1,3 @@
(quale è|qual'è|com'è|come è) {requesttype} {item} (quale è|qual'è|com'è|come è) (la|lo|l'|) {requesttype} {item}
vorrei sapere (quale è|qual'è|com'è|come è|) {requesttype} {item} vorrei sapere (quale è|qual'è|com'è|come è|) (la|lo|l'|) {requesttype} {item}
dimmmi (quale è|qual'è|com'è|come è|) {requesttype} {item} dimmmi (quale è|qual'è|com'è|come è|) (la|lo|l'|) {requesttype} {item}