python-openhab-rest-client 0.2.1__tar.gz → 0.2.2__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.
Files changed (108) hide show
  1. {python_openhab_rest_client-0.2.1/python_openhab_rest_client.egg-info → python_openhab_rest_client-0.2.2}/PKG-INFO +1 -1
  2. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/Client.py +9 -6
  3. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/tests/ItemEvents.py +1 -0
  4. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2/python_openhab_rest_client.egg-info}/PKG-INFO +1 -1
  5. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/setup.py +1 -1
  6. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/LICENSE +0 -0
  7. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/README.md +0 -0
  8. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/Actions.py +0 -0
  9. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/Addons.py +0 -0
  10. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/Audio.py +0 -0
  11. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/Auth.py +0 -0
  12. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/ChannelTypes.py +0 -0
  13. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/ConfigDescriptions.py +0 -0
  14. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/Discovery.py +0 -0
  15. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/Events.py +0 -0
  16. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/Iconsets.py +0 -0
  17. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/Inbox.py +0 -0
  18. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/Items.py +0 -0
  19. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/Links.py +0 -0
  20. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/Logging.py +0 -0
  21. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/ModuleTypes.py +0 -0
  22. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/Persistence.py +0 -0
  23. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/ProfileTypes.py +0 -0
  24. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/Rules.py +0 -0
  25. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/Services.py +0 -0
  26. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/Sitemaps.py +0 -0
  27. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/Systeminfo.py +0 -0
  28. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/Tags.py +0 -0
  29. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/Templates.py +0 -0
  30. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/ThingTypes.py +0 -0
  31. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/Things.py +0 -0
  32. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/Transformations.py +0 -0
  33. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/UI.py +0 -0
  34. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/UUID.py +0 -0
  35. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/Voice.py +0 -0
  36. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/__init__.py +0 -0
  37. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/tests/Actions.py +0 -0
  38. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/tests/Addons.py +0 -0
  39. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/tests/Audio.py +0 -0
  40. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/tests/Auth.py +0 -0
  41. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/tests/ChannelEvents.py +0 -0
  42. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/tests/ChannelTypes.py +0 -0
  43. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/tests/ConfigDescriptions.py +0 -0
  44. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/tests/Discovery.py +0 -0
  45. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/tests/Events.py +0 -0
  46. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/tests/Iconsets.py +0 -0
  47. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/tests/Inbox.py +0 -0
  48. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/tests/InboxEvents.py +0 -0
  49. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/tests/Items.py +0 -0
  50. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/tests/LinkEvents.py +0 -0
  51. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/tests/Links.py +0 -0
  52. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/tests/Logging.py +0 -0
  53. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/tests/ModuleTypes.py +0 -0
  54. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/tests/Persistence.py +0 -0
  55. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/tests/ProfileTypes.py +0 -0
  56. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/tests/Rules.py +0 -0
  57. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/tests/Services.py +0 -0
  58. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/tests/Sitemaps.py +0 -0
  59. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/tests/Systeminfo.py +0 -0
  60. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/tests/Tags.py +0 -0
  61. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/tests/Templates.py +0 -0
  62. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/tests/ThingEvents.py +0 -0
  63. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/tests/ThingTypes.py +0 -0
  64. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/tests/Things.py +0 -0
  65. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/tests/Transformations.py +0 -0
  66. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/tests/UI.py +0 -0
  67. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/tests/UUID.py +0 -0
  68. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/tests/Voice.py +0 -0
  69. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/openhab/tests/__init__.py +0 -0
  70. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/python_openhab_rest_client.egg-info/SOURCES.txt +0 -0
  71. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/python_openhab_rest_client.egg-info/dependency_links.txt +0 -0
  72. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/python_openhab_rest_client.egg-info/requires.txt +0 -0
  73. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/python_openhab_rest_client.egg-info/top_level.txt +0 -0
  74. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/setup.cfg +0 -0
  75. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/tests/Actions.py +0 -0
  76. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/tests/Addons.py +0 -0
  77. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/tests/Audio.py +0 -0
  78. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/tests/Auth.py +0 -0
  79. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/tests/ChannelEvents.py +0 -0
  80. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/tests/ChannelTypes.py +0 -0
  81. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/tests/ConfigDescriptions.py +0 -0
  82. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/tests/Discovery.py +0 -0
  83. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/tests/Events.py +0 -0
  84. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/tests/Iconsets.py +0 -0
  85. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/tests/Inbox.py +0 -0
  86. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/tests/InboxEvents.py +0 -0
  87. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/tests/ItemEvents.py +0 -0
  88. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/tests/Items.py +0 -0
  89. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/tests/LinkEvents.py +0 -0
  90. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/tests/Links.py +0 -0
  91. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/tests/Logging.py +0 -0
  92. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/tests/ModuleTypes.py +0 -0
  93. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/tests/Persistence.py +0 -0
  94. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/tests/ProfileTypes.py +0 -0
  95. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/tests/Rules.py +0 -0
  96. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/tests/Services.py +0 -0
  97. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/tests/Sitemaps.py +0 -0
  98. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/tests/Systeminfo.py +0 -0
  99. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/tests/Tags.py +0 -0
  100. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/tests/Templates.py +0 -0
  101. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/tests/ThingEvents.py +0 -0
  102. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/tests/ThingTypes.py +0 -0
  103. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/tests/Things.py +0 -0
  104. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/tests/Transformations.py +0 -0
  105. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/tests/UI.py +0 -0
  106. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/tests/UUID.py +0 -0
  107. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/tests/Voice.py +0 -0
  108. {python_openhab_rest_client-0.2.1 → python_openhab_rest_client-0.2.2}/tests/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-openhab-rest-client
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: A Python client for the openHAB REST API. This library enables easy interaction with the openHAB REST API to control smart home devices, retrieve status information, and process events.
5
5
  Home-page: https://github.com/Michdo93/python-openhab-rest-client
6
6
  Author: Michael Christian Dörflinger
@@ -1,6 +1,4 @@
1
1
  import requests
2
- import json
3
-
4
2
 
5
3
  class OpenHABClient:
6
4
  def __init__(self, url: str, username: str = None, password: str = None, token: str = None):
@@ -158,10 +156,11 @@ class OpenHABClient:
158
156
 
159
157
  :return: The response object with the SSE stream.
160
158
  """
159
+ self.session.headers.update({})
161
160
  if self.username is not None and self.password is not None:
162
- return self.session.get(url, auth=self.auth, stream=True)
161
+ return requests.get(url, auth=self.auth, headers={}, stream=True)
163
162
  else:
164
- return self.session.get(url, stream=True)
163
+ return requests.get(url, headers={}, stream=True)
165
164
 
166
165
  def __executeSSE(self, url: str, header: dict = {}):
167
166
  """
@@ -172,10 +171,14 @@ class OpenHABClient:
172
171
 
173
172
  :return: The response object with the SSE stream.
174
173
  """
174
+ if header is None:
175
+ header = {}
176
+
177
+ self.session.headers.update(header)
175
178
  if self.username is not None and self.password is not None:
176
- return self.session.get(url, auth=self.auth, headers=header, stream=True)
179
+ return requests.get(url, auth=self.auth, headers=header, stream=True)
177
180
  else:
178
- return self.session.get(url, headers=header, stream=True)
181
+ return requests.get(url, headers=header, stream=True)
179
182
 
180
183
  def get(self, endpoint: str, header: dict = None, params: dict = None):
181
184
  """
@@ -106,6 +106,7 @@ class ItemEventsTest:
106
106
 
107
107
  try:
108
108
  response = self.itemEventsAPI.ItemStateChangedEvent()
109
+ print("Response ItemStateChangedEvent():", response)
109
110
  with response as events:
110
111
  for line in events.iter_lines():
111
112
  line = line.decode()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-openhab-rest-client
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: A Python client for the openHAB REST API. This library enables easy interaction with the openHAB REST API to control smart home devices, retrieve status information, and process events.
5
5
  Home-page: https://github.com/Michdo93/python-openhab-rest-client
6
6
  Author: Michael Christian Dörflinger
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="python-openhab-rest-client",
5
- version="0.2.1",
5
+ version="0.2.2",
6
6
  packages=find_packages(),
7
7
  install_requires=[
8
8
  "requests"