Skip to content
This repository has been archived by the owner on Jun 16, 2024. It is now read-only.

Add SSL client certificate config option #106

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ Note that Home Assistant includes a component (`emulated_hue`) to communicate wi
| `url` | `https://home-assistant.io/demo/` | **Yes** | The API endpoint of your Home Assistant instance. |
| `password ` | `securepassword` | **Yes** | The API password of your Home Assistant instance. |
| `ssl_verify` | `mycert.crt` | No | This will be passed as the `verify` parameter for all requests; see [here](http://docs.python-requests.org/en/master/user/advanced/#ssl-cert-verification) for options. |
| `ssl_client` | `['mycert.crt','mycert.key']` | No | This will be passed as the `cert` parameter for all requests; see [here](http://docs.python-requests.org/en/master/user/advanced/#ssl-cert-verification) for options. |
| `expose_by_default` | `true` | No | Whether or not entities should be exposed to Alexa by default. If not specified, this defaults to true. |
| `exposed_domains` | `["alert", "automation", "climate", "cover", "fan", "garage_door", "group", "input_boolean", "input_slider", "light", "lock", "media_player", "scene", "script", "switch"]` | No | A JSON array of entity types to expose to Alexa. If not provided, the example value is used. |
| `entity_suffixes` | `{"group": "Group", "scene": "Scene"}` | No | A JSON object of entity suffixes to expose to Alexa. If not provided, the example value is used. |
Expand Down
2 changes: 2 additions & 0 deletions haaska.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def __init__(self, config):
'content-type': 'application/json',
'User-Agent': agent_fmt}
self.session.verify = config.ssl_verify
self.session.cert = config.ssl_client

def build_url(self, relurl):
return '%s/%s' % (self.config.url, relurl)
Expand Down Expand Up @@ -627,6 +628,7 @@ def __init__(self, filename=None, optsDict=None):
opts['exposed_domains'] = \
sorted(self.get(['exposed_domains', 'ha_allowed_entities'],
default=DOMAINS.keys()))
opts['ssl_client'] = self.get(['ssl_client'],default='')

default_entity_suffixes = {'group': 'Group', 'scene': 'Scene'}
opts['entity_suffixes'] = {domain: '' for domain in DOMAINS.keys()}
Expand Down