pyhausbus 1.0.5__py2.py3-none-any.whl → 1.0.7__py2.py3-none-any.whl

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 (39) hide show
  1. pyhausbus/Templates.py +8 -5
  2. pyhausbus/de/hausbus/homeassistant/proxy/AnalogEingang.py +18 -19
  3. pyhausbus/de/hausbus/homeassistant/proxy/Controller.py +104 -105
  4. pyhausbus/de/hausbus/homeassistant/proxy/Counter.py +16 -17
  5. pyhausbus/de/hausbus/homeassistant/proxy/CurrentReader.py +36 -37
  6. pyhausbus/de/hausbus/homeassistant/proxy/DaliLine.py +16 -17
  7. pyhausbus/de/hausbus/homeassistant/proxy/DigitalPort.py +8 -9
  8. pyhausbus/de/hausbus/homeassistant/proxy/Dimmer.py +24 -25
  9. pyhausbus/de/hausbus/homeassistant/proxy/Drucksensor.py +18 -19
  10. pyhausbus/de/hausbus/homeassistant/proxy/Ethernet.py +14 -15
  11. pyhausbus/de/hausbus/homeassistant/proxy/Feuchtesensor.py +20 -21
  12. pyhausbus/de/hausbus/homeassistant/proxy/Gateway.py +22 -23
  13. pyhausbus/de/hausbus/homeassistant/proxy/Helligkeitssensor.py +20 -21
  14. pyhausbus/de/hausbus/homeassistant/proxy/IRSensor.py +14 -15
  15. pyhausbus/de/hausbus/homeassistant/proxy/Led.py +32 -33
  16. pyhausbus/de/hausbus/homeassistant/proxy/LogicalButton.py +32 -33
  17. pyhausbus/de/hausbus/homeassistant/proxy/ModBusMaster.py +6 -7
  18. pyhausbus/de/hausbus/homeassistant/proxy/ModbusSlave.py +0 -1
  19. pyhausbus/de/hausbus/homeassistant/proxy/PCA9555.py +2 -3
  20. pyhausbus/de/hausbus/homeassistant/proxy/PCServer.py +18 -19
  21. pyhausbus/de/hausbus/homeassistant/proxy/PIDController.py +16 -17
  22. pyhausbus/de/hausbus/homeassistant/proxy/PT1000.py +20 -21
  23. pyhausbus/de/hausbus/homeassistant/proxy/PowerMeter.py +20 -21
  24. pyhausbus/de/hausbus/homeassistant/proxy/RFIDReader.py +20 -21
  25. pyhausbus/de/hausbus/homeassistant/proxy/RGBDimmer.py +16 -17
  26. pyhausbus/de/hausbus/homeassistant/proxy/Rollladen.py +30 -31
  27. pyhausbus/de/hausbus/homeassistant/proxy/Schalter.py +30 -31
  28. pyhausbus/de/hausbus/homeassistant/proxy/SnmpAgent.py +0 -1
  29. pyhausbus/de/hausbus/homeassistant/proxy/SystemTime.py +8 -9
  30. pyhausbus/de/hausbus/homeassistant/proxy/Taster.py +34 -35
  31. pyhausbus/de/hausbus/homeassistant/proxy/Taupunkt.py +20 -21
  32. pyhausbus/de/hausbus/homeassistant/proxy/TcpClient.py +8 -9
  33. pyhausbus/de/hausbus/homeassistant/proxy/Temperatursensor.py +20 -21
  34. pyhausbus/de/hausbus/homeassistant/proxy/Wetter.py +4 -5
  35. pyhausbus/de/hausbus/homeassistant/proxy/WiFi.py +14 -15
  36. {pyhausbus-1.0.5.dist-info → pyhausbus-1.0.7.dist-info}/METADATA +1 -1
  37. {pyhausbus-1.0.5.dist-info → pyhausbus-1.0.7.dist-info}/RECORD +39 -39
  38. {pyhausbus-1.0.5.dist-info → pyhausbus-1.0.7.dist-info}/LICENSE +0 -0
  39. {pyhausbus-1.0.5.dist-info → pyhausbus-1.0.7.dist-info}/WHEEL +0 -0
pyhausbus/Templates.py CHANGED
@@ -2,6 +2,7 @@ import os
2
2
  from collections import defaultdict
3
3
  from typing import List, Dict, Optional
4
4
  from pyhausbus.de.hausbus.homeassistant.proxy.controller.params.EFirmwareId import EFirmwareId
5
+ from pyhausbus.HausBusUtils import LOGGER
5
6
 
6
7
  def load_file(path: str) -> list[str]:
7
8
  try:
@@ -15,7 +16,8 @@ def load_file(path: str) -> list[str]:
15
16
  return []
16
17
 
17
18
  class Templates:
18
- template_root_dir = "pyhausbus/templates/"
19
+ template_root_dir = os.path.join(os.path.dirname(__file__), "templates")
20
+ LOGGER.debug(f"templateRootDir = {self.template_root_dir}")
19
21
  filter_non_existing = True
20
22
  _instance = None
21
23
  class_mappings: Dict[str, str] = {}
@@ -25,7 +27,7 @@ class Templates:
25
27
  self.feature_names: Dict['ModuleType', List['FeatureEntry']] = {}
26
28
 
27
29
  try:
28
- lines = load_file(self.template_root_dir + "deviceTypes.def")
30
+ lines = load_file(os.path.join(self.template_root_dir, "deviceTypes.def"))
29
31
  for line in lines:
30
32
  tokens = line.split(",")
31
33
  firmware_id = EFirmwareId.value_of(tokens[0])
@@ -58,16 +60,17 @@ class Templates:
58
60
 
59
61
  quit()'''
60
62
 
61
- lines = load_file(self.template_root_dir + "classMapping.def")
63
+ lines = load_file(os.path.join(self.template_root_dir, "classMapping.def"))
62
64
  if lines:
63
65
  for line in lines:
64
66
  tokens = line.split(",")
65
67
  orig_name = tokens[0]
66
68
  mapped_name = tokens[1]
67
69
  Templates.class_mappings[orig_name] = mapped_name
68
-
70
+ LOGGER.debug(f"module types = {len(self.module_types)}")
71
+ LOGGER.debug(f"feature names = {len(self.feature_names)}")
69
72
  except Exception as e:
70
- print(f"Fehler beim Initialisieren der Templates: {e}")
73
+ LOGGER.error(f"Fehler beim Initialisieren der Templates: {e}")
71
74
 
72
75
  @classmethod
73
76
  def get_instance(cls):
@@ -1,4 +1,3 @@
1
- import logging
2
1
  from pyhausbus.HausBusCommand import HausBusCommand
3
2
  from pyhausbus.ABusFeature import *
4
3
  from pyhausbus.ResultWorker import ResultWorker
@@ -20,51 +19,51 @@ class AnalogEingang(ABusFeature):
20
19
  """
21
20
  """
22
21
  def evLow(self):
23
- logging.info("evLow")
22
+ LOGGER.debug("evLow")
24
23
  hbCommand = HausBusCommand(self.objectId, 200, "evLow")
25
24
  ResultWorker()._setResultInfo(None,self.getObjectId())
26
25
  hbCommand.send()
27
- logging.info("returns")
26
+ LOGGER.debug("returns")
28
27
 
29
28
  """
30
29
  """
31
30
  def evInRange(self):
32
- logging.info("evInRange")
31
+ LOGGER.debug("evInRange")
33
32
  hbCommand = HausBusCommand(self.objectId, 201, "evInRange")
34
33
  ResultWorker()._setResultInfo(None,self.getObjectId())
35
34
  hbCommand.send()
36
- logging.info("returns")
35
+ LOGGER.debug("returns")
37
36
 
38
37
  """
39
38
  """
40
39
  def evHigh(self):
41
- logging.info("evHigh")
40
+ LOGGER.debug("evHigh")
42
41
  hbCommand = HausBusCommand(self.objectId, 202, "evHigh")
43
42
  ResultWorker()._setResultInfo(None,self.getObjectId())
44
43
  hbCommand.send()
45
- logging.info("returns")
44
+ LOGGER.debug("returns")
46
45
 
47
46
  """
48
47
  @param value .
49
48
  @param lastEvent .
50
49
  """
51
50
  def evStatus(self, value:int, lastEvent:ELastEvent):
52
- logging.info("evStatus"+" value = "+str(value)+" lastEvent = "+str(lastEvent))
51
+ LOGGER.debug("evStatus"+" value = "+str(value)+" lastEvent = "+str(lastEvent))
53
52
  hbCommand = HausBusCommand(self.objectId, 203, "evStatus")
54
53
  hbCommand.addWord(value)
55
54
  hbCommand.addByte(lastEvent.value)
56
55
  ResultWorker()._setResultInfo(None,self.getObjectId())
57
56
  hbCommand.send()
58
- logging.info("returns")
57
+ LOGGER.debug("returns")
59
58
 
60
59
  """
61
60
  """
62
61
  def getConfiguration(self):
63
- logging.info("getConfiguration")
62
+ LOGGER.debug("getConfiguration")
64
63
  hbCommand = HausBusCommand(self.objectId, 0, "getConfiguration")
65
64
  ResultWorker()._setResultInfo(Configuration,self.getObjectId())
66
65
  hbCommand.send()
67
- logging.info("returns")
66
+ LOGGER.debug("returns")
68
67
 
69
68
  """
70
69
  @param lowerThreshold untere Schwelle.
@@ -77,7 +76,7 @@ class AnalogEingang(ABusFeature):
77
76
  @param deltaSensorID Die InstanceID des Sensors auf diesem Controller.
78
77
  """
79
78
  def setConfiguration(self, lowerThreshold:int, upperThreshold:int, reportTimeBase:int, minReportTime:int, maxReportTime:int, hysteresis:int, calibration:int, deltaSensorID:int):
80
- logging.info("setConfiguration"+" lowerThreshold = "+str(lowerThreshold)+" upperThreshold = "+str(upperThreshold)+" reportTimeBase = "+str(reportTimeBase)+" minReportTime = "+str(minReportTime)+" maxReportTime = "+str(maxReportTime)+" hysteresis = "+str(hysteresis)+" calibration = "+str(calibration)+" deltaSensorID = "+str(deltaSensorID))
79
+ LOGGER.debug("setConfiguration"+" lowerThreshold = "+str(lowerThreshold)+" upperThreshold = "+str(upperThreshold)+" reportTimeBase = "+str(reportTimeBase)+" minReportTime = "+str(minReportTime)+" maxReportTime = "+str(maxReportTime)+" hysteresis = "+str(hysteresis)+" calibration = "+str(calibration)+" deltaSensorID = "+str(deltaSensorID))
81
80
  hbCommand = HausBusCommand(self.objectId, 1, "setConfiguration")
82
81
  hbCommand.addWord(lowerThreshold)
83
82
  hbCommand.addWord(upperThreshold)
@@ -89,16 +88,16 @@ class AnalogEingang(ABusFeature):
89
88
  hbCommand.addByte(deltaSensorID)
90
89
  ResultWorker()._setResultInfo(None,self.getObjectId())
91
90
  hbCommand.send()
92
- logging.info("returns")
91
+ LOGGER.debug("returns")
93
92
 
94
93
  """
95
94
  """
96
95
  def getStatus(self):
97
- logging.info("getStatus")
96
+ LOGGER.debug("getStatus")
98
97
  hbCommand = HausBusCommand(self.objectId, 2, "getStatus")
99
98
  ResultWorker()._setResultInfo(Status,self.getObjectId())
100
99
  hbCommand.send()
101
- logging.info("returns")
100
+ LOGGER.debug("returns")
102
101
 
103
102
  """
104
103
  @param lowerThreshold untere Schwelle.
@@ -111,7 +110,7 @@ class AnalogEingang(ABusFeature):
111
110
  @param deltaSensorID Die InstanceID des Sensors auf diesem Controller.
112
111
  """
113
112
  def Configuration(self, lowerThreshold:int, upperThreshold:int, reportTimeBase:int, minReportTime:int, maxReportTime:int, hysteresis:int, calibration:int, deltaSensorID:int):
114
- logging.info("Configuration"+" lowerThreshold = "+str(lowerThreshold)+" upperThreshold = "+str(upperThreshold)+" reportTimeBase = "+str(reportTimeBase)+" minReportTime = "+str(minReportTime)+" maxReportTime = "+str(maxReportTime)+" hysteresis = "+str(hysteresis)+" calibration = "+str(calibration)+" deltaSensorID = "+str(deltaSensorID))
113
+ LOGGER.debug("Configuration"+" lowerThreshold = "+str(lowerThreshold)+" upperThreshold = "+str(upperThreshold)+" reportTimeBase = "+str(reportTimeBase)+" minReportTime = "+str(minReportTime)+" maxReportTime = "+str(maxReportTime)+" hysteresis = "+str(hysteresis)+" calibration = "+str(calibration)+" deltaSensorID = "+str(deltaSensorID))
115
114
  hbCommand = HausBusCommand(self.objectId, 128, "Configuration")
116
115
  hbCommand.addWord(lowerThreshold)
117
116
  hbCommand.addWord(upperThreshold)
@@ -123,17 +122,17 @@ class AnalogEingang(ABusFeature):
123
122
  hbCommand.addByte(deltaSensorID)
124
123
  ResultWorker()._setResultInfo(None,self.getObjectId())
125
124
  hbCommand.send()
126
- logging.info("returns")
125
+ LOGGER.debug("returns")
127
126
 
128
127
  """
129
128
  @param value .
130
129
  """
131
130
  def Status(self, value:int):
132
- logging.info("Status"+" value = "+str(value))
131
+ LOGGER.debug("Status"+" value = "+str(value))
133
132
  hbCommand = HausBusCommand(self.objectId, 129, "Status")
134
133
  hbCommand.addWord(value)
135
134
  ResultWorker()._setResultInfo(None,self.getObjectId())
136
135
  hbCommand.send()
137
- logging.info("returns")
136
+ LOGGER.debug("returns")
138
137
 
139
138