elementapi 0.5__tar.gz → 0.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: elementapi
3
- Version: 0.5
3
+ Version: 0.7
4
4
  Summary: element-iot api client lib
5
5
  Home-page: https://github.com/ZennerIoT/python-elementapi
6
6
  Download-URL: https://github.com/ZennerIoT/python-elementapi/archive/master.zip
@@ -1,7 +1,10 @@
1
1
  try:
2
- import ujson as json
3
- except:
4
- import json
2
+ import orjson as json
3
+ except ImportError:
4
+ try:
5
+ import ujson as json
6
+ except:
7
+ import json
5
8
 
6
9
  import logging
7
10
  import re
@@ -76,7 +79,8 @@ class ElementAPI:
76
79
  sync=False,
77
80
  proxies=None,
78
81
  custom_ca=None,
79
- https_no_verify=False
82
+ https_no_verify=False,
83
+ override_hostname=None
80
84
  ):
81
85
  if baseurl:
82
86
  self.baseurl = baseurl
@@ -103,6 +107,9 @@ class ElementAPI:
103
107
  self.custom_ca = custom_ca
104
108
  self.https_no_verify = https_no_verify
105
109
 
110
+ if override_hostname:
111
+ self.headers['Host'] = "%s:%s" % (override_hostname, port)
112
+
106
113
  self.requestargs = {
107
114
  'headers': self.headers,
108
115
  'proxies': self.proxies
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: elementapi
3
- Version: 0.5
3
+ Version: 0.7
4
4
  Summary: element-iot api client lib
5
5
  Home-page: https://github.com/ZennerIoT/python-elementapi
6
6
  Download-URL: https://github.com/ZennerIoT/python-elementapi/archive/master.zip
@@ -3,7 +3,7 @@ from distutils.core import setup
3
3
  setup(
4
4
  name='elementapi',
5
5
  packages=['elementapi'],
6
- version='0.5',
6
+ version='0.7',
7
7
  description='element-iot api client lib',
8
8
  author='Stefan Reiser',
9
9
  author_email='sr@zenner-iot.com',
File without changes