pyhausbus 1.0.6__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.
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,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyhausbus
3
- Version: 1.0.6
3
+ Version: 1.0.7
4
4
  Summary: Python based library for accessing haus-bus.de modules. Inteded to be used in a Home Assistant integration.
5
5
  Home-page: https://haus-bus.secure-stores.de/
6
6
  Author: Hermann Hoeschen
@@ -630,10 +630,10 @@ pyhausbus/templates/SD485_2E_6-fach-Taster.tpl,sha256=d8ALY9k1pcNSQUGSqSUsIpiRva
630
630
  pyhausbus/templates/SD485_2F_6-fach-Taster.tpl,sha256=d8ALY9k1pcNSQUGSqSUsIpiRvaR0bqoy4onhpfF7bzA,533
631
631
  pyhausbus/templates/SD6_14_Multitaster.tpl,sha256=cneNlLhmyE0RSh1BQK5p8Gz2cRbDOFztfc1_XWy3fAY,451
632
632
  pyhausbus/templates/SD6_1E_Multitaster.tpl,sha256=cneNlLhmyE0RSh1BQK5p8Gz2cRbDOFztfc1_XWy3fAY,451
633
- pyhausbus/Templates.py,sha256=Fo-xYyKUeEgcOo5hYIUUH3vx5DRnDY9jLnykk16hJQg,5333
633
+ pyhausbus/Templates.py,sha256=gtghruC2mTbvzUQ_7bTiIvK4Rnq81NzRuMdbbQNIg8U,5644
634
634
  pyhausbus/UdpReceiveWorker.py,sha256=lQD2O2Rqk3Xvy6Glrlbn1p2n4ZTWW80yxJp3-OsQTcc,2678
635
635
  pyhausbus/WeekTime.py,sha256=o30XyAOEYAQhcWdE2hEX685RNJmo-VCQNPEx1xAFwzk,1287
636
- pyhausbus-1.0.6.dist-info/LICENSE,sha256=LrguBvqK4LI4RXcja3oOYNPAIB5x5HPUXHRlkTkP5Sg,1094
637
- pyhausbus-1.0.6.dist-info/METADATA,sha256=9QAurk7rVxemyk4fXCQ9CS5VrtEZ58GhFOCe80Eold8,1324
638
- pyhausbus-1.0.6.dist-info/WHEEL,sha256=iAMR_6Qh95yyjYIwRxyjpiFq4FhDPemrEV-SyWIQB3U,92
639
- pyhausbus-1.0.6.dist-info/RECORD,,
636
+ pyhausbus-1.0.7.dist-info/LICENSE,sha256=LrguBvqK4LI4RXcja3oOYNPAIB5x5HPUXHRlkTkP5Sg,1094
637
+ pyhausbus-1.0.7.dist-info/METADATA,sha256=NDThp0QVotdWwbJPkOEKF_jt0_EiRRmFooWoagwpLgE,1324
638
+ pyhausbus-1.0.7.dist-info/WHEEL,sha256=iAMR_6Qh95yyjYIwRxyjpiFq4FhDPemrEV-SyWIQB3U,92
639
+ pyhausbus-1.0.7.dist-info/RECORD,,