emerald-hws 0.0.1__tar.gz → 0.0.3__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: emerald_hws
3
- Version: 0.0.1
3
+ Version: 0.0.3
4
4
  Summary: A package to manipulate and monitor Emerald Heat Pump Hot Water Systems
5
5
  Author-email: Ross Williamson <ross@inertia.net.nz>
6
6
  Project-URL: Homepage, https://github.com/ross-w/emerald_hws_py
@@ -12,7 +12,7 @@ Requires-Python: >=3.7
12
12
  Description-Content-Type: text/markdown
13
13
  License-File: LICENSE
14
14
  Requires-Dist: boto3
15
- Requires-Dist: AWSIoTPythonSDK.MQTTLib
15
+ Requires-Dist: AWSIoTPythonSDK
16
16
 
17
17
  # emerald_hws_py
18
18
  Python package for controlling Emerald Heat Pump Hot Water Systems
@@ -4,10 +4,10 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "emerald_hws"
7
- version = "0.0.1"
7
+ version = "0.0.3"
8
8
  dependencies = [
9
9
  "boto3",
10
- "AWSIoTPythonSDK.MQTTLib"
10
+ "AWSIoTPythonSDK"
11
11
  ]
12
12
  authors = [
13
13
  { name="Ross Williamson", email="ross@inertia.net.nz" },
@@ -21,6 +21,15 @@ classifiers = [
21
21
  "Operating System :: OS Independent",
22
22
  ]
23
23
 
24
+ [tool.setuptools]
25
+ include-package-data = true
26
+
27
+ [tool.setuptools.packages.find]
28
+ where = ["src"]
29
+
30
+ [tool.setuptools.package-data]
31
+ "*" = ["*.*"]
32
+
24
33
  [project.urls]
25
34
  "Homepage" = "https://github.com/ross-w/emerald_hws_py"
26
35
  "Bug Tracker" = "https://github.com/ross-w/emerald_hws_py/issues"
@@ -0,0 +1,24 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVM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Z9g3ccaaNnRbobhiCPPE95Dz+I0swSdHynVv/heyNXB
19
+ ve6SbzJ08pGCL72CQnqtKrcgfU28elUSwhXqvfdqlS5sdJ/PHLTyxQGjhdByPq1z
20
+ qwubdQxtRbeOlKyWN7Wg0I8VRw7j6IPdj/3vQQF3zCepYoUz8jcI73HPdwbeyBkd
21
+ iEDPfUYd/x7H4c7/I9vG+o1VTqkC50cRRj70/b17KSa7qWFiNyi2LSr2EIZkyXCn
22
+ 0q23KXB56jzaYyWf/Wi3MOxw+3WKt21gZ7IeyLnp2KhvAotnDU0mV3HaIPzBSlCN
23
+ sSi6
24
+ -----END CERTIFICATE-----
@@ -1,5 +1,6 @@
1
1
  import json
2
2
  import requests
3
+ import os
3
4
  # import logging
4
5
  import boto3
5
6
  import random
@@ -77,6 +78,8 @@ class EmeraldHWS():
77
78
  """ Establishes a connection to Amazon IOT core's MQTT service
78
79
  """
79
80
 
81
+ cert_path = os.path.join(os.path.dirname(__file__), '__assets__', 'SFSRootCAG2.pem')
82
+
80
83
  # Cognito auth
81
84
  identityPoolID = self.COGNITO_IDENTITY_POOL_ID
82
85
  region = self.MQTT_HOST.split('.')[2]
@@ -95,7 +98,7 @@ class EmeraldHWS():
95
98
 
96
99
  # AWSIoTMQTTClient configuration
97
100
  myAWSIoTMQTTClient.configureEndpoint(self.MQTT_HOST, 443)
98
- myAWSIoTMQTTClient.configureCredentials("./SFSRootCAG2.pem")
101
+ myAWSIoTMQTTClient.configureCredentials(cert_path)
99
102
  myAWSIoTMQTTClient.configureIAMCredentials(AccessKeyId, SecretKey, SessionToken)
100
103
  myAWSIoTMQTTClient.configureAutoReconnectBackoffTime(1, 32, 20)
101
104
  myAWSIoTMQTTClient.configureOfflinePublishQueueing(-1) # Infinite offline Publish queueing
@@ -237,6 +240,19 @@ class EmeraldHWS():
237
240
  mode_status = self.getFullStatus(id).get("last_state").get("mode")
238
241
  return mode_status
239
242
 
243
+ def getInfo(self, id):
244
+ """ Returns identifying details for the specified HWS
245
+ :param id: The UUID of the HWS to query
246
+ """
247
+ full_status = self.getFullStatus(id)
248
+
249
+ return {'id': id,
250
+ 'serial_number': full_status.get("serial_number"),
251
+ 'brand': full_status.get("brand"),
252
+ 'hw_version': full_status.get("hw_version"),
253
+ 'soft_version': full_status.get("soft_version")
254
+ }
255
+
240
256
  def listHWS(self):
241
257
  """ Returns a list of UUIDs of all discovered HWS
242
258
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: emerald_hws
3
- Version: 0.0.1
3
+ Version: 0.0.3
4
4
  Summary: A package to manipulate and monitor Emerald Heat Pump Hot Water Systems
5
5
  Author-email: Ross Williamson <ross@inertia.net.nz>
6
6
  Project-URL: Homepage, https://github.com/ross-w/emerald_hws_py
@@ -12,7 +12,7 @@ Requires-Python: >=3.7
12
12
  Description-Content-Type: text/markdown
13
13
  License-File: LICENSE
14
14
  Requires-Dist: boto3
15
- Requires-Dist: AWSIoTPythonSDK.MQTTLib
15
+ Requires-Dist: AWSIoTPythonSDK
16
16
 
17
17
  # emerald_hws_py
18
18
  Python package for controlling Emerald Heat Pump Hot Water Systems
@@ -7,4 +7,5 @@ src/emerald_hws.egg-info/PKG-INFO
7
7
  src/emerald_hws.egg-info/SOURCES.txt
8
8
  src/emerald_hws.egg-info/dependency_links.txt
9
9
  src/emerald_hws.egg-info/requires.txt
10
- src/emerald_hws.egg-info/top_level.txt
10
+ src/emerald_hws.egg-info/top_level.txt
11
+ src/emerald_hws/__assets__/SFSRootCAG2.pem
@@ -0,0 +1,2 @@
1
+ boto3
2
+ AWSIoTPythonSDK
@@ -1,2 +0,0 @@
1
- boto3
2
- AWSIoTPythonSDK.MQTTLib
File without changes
File without changes
File without changes