Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Candle - the privacy friendly smart home authored Mar 7, 2022
1 parent 1bd4b88 commit dd8e664
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
6 changes: 5 additions & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@
"description": "If this is a satellite, enabling this will allow you to control things on this satellite using your voice. It's recommended to give things on satellites unique names. For example, call 'radio' something like 'kitchen radio' instead. If a thing with the same name exists on the main controller and on a satellite, a voice command will always favour controlling the satellite's thing.",
"type": "boolean"
},
"Disable security": {
"description": "Advanced. Disabling security might make Voco play nice with older/other versions of Candle or the Webthings Gateway.",
"type": "boolean"
},
"Debugging": {
"description": "Advanced. Debugging allows you to diagnose any issues with the add-on. If enabled it will result in a lot more debug data in the internal log (which can be found under settings -> developer -> view internal logs).",
"type": "boolean"
Expand All @@ -184,7 +188,7 @@
}
},
"short_name": "Voco",
"version": "2.8.4",
"version": "2.8.5",
"web_accessible_resources": [
"css/*.css",
"images/*.svg",
Expand Down
23 changes: 22 additions & 1 deletion pkg/voco_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def __init__(self, verbose=True):

# MQTT client
self.mqtt_client = None
self.mqtt_port = 1883
self.mqtt_port = 1884
self.mqtt_connected = False
self.voco_connected = True
self.mqtt_others = {}
Expand All @@ -307,6 +307,7 @@ def __init__(self, verbose=True):
self.should_restart_mqtt = True
self.mqtt_busy_connecting = False
self.mqtt_connected_succesfully_at_least_once = False
self.disable_security = False


# Things
Expand Down Expand Up @@ -788,6 +789,20 @@ def add_from_config(self):
if self.DEBUG:
print("Debugging enabled")


# Disable security
try:
if 'Disable security' in config:
self.disable_security = bool(config['Disable security'])
if self.disable_security:
self.mqtt_port = 1883 # might still be overridden by the user, but 1883 is now the default.
print("WARNING, VOCO SECURITY HAS BEEN DISABLED")


except Exception as ex:
print("Error loading disable security setting(s) from config: " + str(ex))


try:
store_updated_settings = False
if 'Microphone' in config:
Expand Down Expand Up @@ -966,6 +981,10 @@ def add_from_config(self):
except Exception as ex:
print("Error loading voice setting(s) from config: " + str(ex))








Expand Down Expand Up @@ -2625,6 +2644,8 @@ def run_mqtt(self):
self.mqtt_client.on_disconnect = self.on_disconnect
self.mqtt_client.on_message = self.on_message
self.mqtt_client.on_publish = self.on_publish
if self.disable_security == False:
self.mqtt_client.username_pw_set(username="candle", password="smarthome")
if self.DEBUG:
print("self.persistent_data['mqtt_server'] = " + str(self.persistent_data['mqtt_server']))

Expand Down

0 comments on commit dd8e664

Please sign in to comment.