z4d-certified-devices 4.259__py3-none-any.whl → 5.260__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.
@@ -1,48 +1,27 @@
1
1
  {
2
- "_comment": "Sonoff Basic ZBR3",
3
- "_version": "1.0",
4
- "Ep": {
5
- "01": {
6
- "0000": "",
7
- "0003": "",
8
- "0004": "",
9
- "0005": "",
10
- "0006": "",
11
- "1000": "",
12
- "Type": "Switch"
13
- },
14
- "f2": {
15
- "0021": "",
16
- "Type": ""
17
- }
18
- },
19
- "Type": "",
20
- "ClusterToBind": [
21
- "0006"
22
- ],
23
- "ConfigureReporting": {
24
- "0006": {
25
- "Attributes": {
26
- "0000": {
27
- "DataType": "10",
28
- "MinInterval": "0001",
29
- "MaxInterval": "012C",
30
- "TimeOut": "0000",
31
- "Change": "01"
32
- }
33
- }
34
- }
35
- },
36
- "ReadAttributes": {
37
- "0000": [
38
- "0000",
39
- "0004",
40
- "0005",
41
- "0006",
42
- "0007"
43
- ],
44
- "0006": [
45
- "0000"
46
- ]
47
- }
48
- }
2
+ "_comment": "Sonoff Basic ZBR3",
3
+ "_version": "1.0",
4
+ "Ep": {
5
+ "01": {
6
+ "0000": "",
7
+ "0003": "",
8
+ "0004": "",
9
+ "0005": "",
10
+ "0006": "",
11
+ "1000": "",
12
+ "Type": "Switch"
13
+ },
14
+ "f2": {
15
+ "0021": "",
16
+ "Type": ""
17
+ }
18
+ },
19
+ "Type": "",
20
+ "ClusterToBind": [ ],
21
+ "ConfigureReporting": {
22
+ },
23
+ "ReadAttributes": {
24
+ "0000": [ "0000", "0004", "0005", "0006", "0007" ],
25
+ "0006": [ "0000" ]
26
+ }
27
+ }
@@ -13,6 +13,7 @@
13
13
  import json
14
14
  import os.path
15
15
  from pathlib import Path
16
+ import os
16
17
 
17
18
  from .version import __version__
18
19
 
@@ -23,41 +24,43 @@ def z4d_import_device_configuration(self, path_name):
23
24
  plugin_version = self.pluginParameters.get("PluginVersion")
24
25
 
25
26
  if not os.path.isdir(model_certified):
26
- self.log.logging("z4dCertifiedDevices", "Status", f"none existing Z4D Certified Db at {model_certified} !!!")
27
+ self.log.logging("z4dCertifiedDevices", "Status", f"Z4D found an empty Certified Db {model_certified}")
27
28
  return
28
29
 
29
30
  for device_brand in os.listdir(model_certified):
30
31
  if device_brand in ("README.md", ".PRECIOUS"):
31
32
  continue
32
-
33
- model_directory = model_certified / device_brand
34
-
33
+
34
+ model_directory = Path(model_certified) / device_brand
35
+
35
36
  for model_device_file in os.listdir(model_directory):
36
37
  if model_device_file in ("README.md", ".PRECIOUS"):
37
38
  continue
38
-
39
+
39
40
  filename = model_directory / model_device_file
41
+
40
42
  try:
41
43
  with open(filename, "rt", encoding='utf-8') as file_handle:
42
44
  model_definition = json.load(file_handle)
43
-
44
- except ValueError as error:
45
- self.log.logging("z4dCertifiedDevices", "Error", f"JSON ConfFile: {filename} load failed with error: {error}, skiping this config file.")
46
- continue
47
-
48
- except Exception as error:
49
- self.log.logging("z4dCertifiedDevices", "Error", f"JSON ConfFile: {filename} load general error: {error}, skiping this config file.")
45
+
46
+ except (ValueError, Exception) as error:
47
+ error_type = type(error).__name__
48
+ error_msg = f"JSON ConfFile: {filename} load failed with error: {error_type}, skipping this config file."
49
+ self.log.logging("z4dCertifiedDevices", "Error", error_msg)
50
50
  continue
51
-
52
- device_model_name = _get_model_name(model_device_file )
51
+
52
+ device_model_name = _get_model_name(model_device_file)
53
+
53
54
  if device_model_name in self.DeviceConf:
54
55
  self.log.logging("z4dCertifiedDevices", "Debug", f"Config for {device_brand}/{device_model_name} not loaded as already defined")
55
56
  continue
56
-
57
+
57
58
  self.log.logging("z4dCertifiedDevices", "Debug", f"processing certified {device_brand}/{device_model_name}")
58
-
59
+
59
60
  if not _is_model_requirement_match_plugin_version(self, model_definition, plugin_version):
60
- self.log.logging( "z4dCertifiedDevices", "Error", f"Certified Devices load skip this Certified device %{device_brand}-{device_model_name} requires Plugin version {model_definition['MinPluginVersion']}")
61
+ min_plugin_version = model_definition.get("MinPluginVersion", "N/A")
62
+ error_msg = f"Certified Devices load skip this Certified device {device_brand}-{device_model_name} requires Plugin version {min_plugin_version}"
63
+ self.log.logging("z4dCertifiedDevices", "Error", error_msg)
61
64
  continue
62
65
 
63
66
  _process_device_config_file(self, device_model_name, model_definition)
@@ -65,13 +68,12 @@ def z4d_import_device_configuration(self, path_name):
65
68
  self.log.logging("z4dCertifiedDevices", "Debug", f"Config loaded: {self.DeviceConf.keys()}")
66
69
  self.log.logging("z4dCertifiedDevices", "Debug", f"Certified Devices ModelManufMapping loaded - {self.ModelManufMapping.keys()}")
67
70
 
68
- self.log.logging("z4dCertifiedDevices", "Status", f"{len(self.DeviceConf)} Certified devices loaded from z4d repository.")
71
+ self.log.logging("z4dCertifiedDevices", "Status", f"Z4D loads {len(self.DeviceConf)} Certified devices from repository.")
72
+
69
73
 
70
- def _get_model_name(model_device_file ):
71
- """ Purpose is to remove .json from filename to get the Device Model"""
72
- basename = os.path.basename(model_device_file)
73
- device_model_name = os.path.splitext(basename)[0]
74
- return device_model_name
74
+ def _get_model_name(model_device_file):
75
+ """Remove .json from filename to get the Device Model."""
76
+ return os.path.splitext(os.path.basename(model_device_file))[0]
75
77
 
76
78
 
77
79
  def _is_model_requirement_match_plugin_version(self, model_definition, plugin_version):
@@ -80,10 +82,8 @@ def _is_model_requirement_match_plugin_version(self, model_definition, plugin_ve
80
82
 
81
83
 
82
84
  def _process_device_config_file(self, device_model_name, model_definition):
83
- """ let's load the config into DeviceConf , and if needed (Tuya) lets also load into the model name mapping"""
84
- self.DeviceConf[device_model_name] = dict(model_definition)
85
- if "Identifier" not in model_definition:
86
- return
87
- for identifier_tuple in model_definition["Identifier"]:
88
- self.ModelManufMapping[ tuple(identifier_tuple) ] = device_model_name
89
-
85
+ """Load the config into DeviceConf and, if needed (Tuya), load into the model name mapping."""
86
+ self.DeviceConf[device_model_name] = model_definition
87
+ identifier_list = model_definition.get("Identifier", [])
88
+ for identifier_tuple in identifier_list:
89
+ self.ModelManufMapping[tuple(identifier_tuple)] = device_model_name
@@ -1,3 +1,3 @@
1
- MAJOR_VERSION = 4
2
- MINOR_VERSION = 259
1
+ MAJOR_VERSION = 5
2
+ MINOR_VERSION = 260
3
3
  __version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: z4d-certified-devices
3
- Version: 4.259
3
+ Version: 5.260
4
4
  Summary: "Certified devices for Zigbee for Domoticz plugin"
5
5
  Home-page: https://github.com/zigbeefordomoticz/z4d-certified-devices
6
6
  Author: "Patrick Pichon"
@@ -1,5 +1,5 @@
1
- z4d_certified_devices/__init__.py,sha256=i5sQ3ShnztbqZ3IeUr-smCqhcYLIaHZP5fkIoTXQZIo,3938
2
- z4d_certified_devices/version.py,sha256=yc6ssrzJLuJBj27NYIUHpWOy6YyK_CNhDTMbcwZECrs,87
1
+ z4d_certified_devices/__init__.py,sha256=GZ6zf1bgjFvi5yOBDJp9R4Hea53iA-MoqbTcESSa6ms,3860
2
+ z4d_certified_devices/version.py,sha256=2YuZIOKjWhfvHuIMHQ_DV-oDGFzCFtdibID2jlshV7k,87
3
3
  z4d_certified_devices/Certified/README.md,sha256=1WnlKFf_NJon6zCJ0zfbBIOHES0L2YoE9EjzI2zhlDA,1415
4
4
  z4d_certified_devices/Certified/Adeo/LDSENK02F.json,sha256=eYpL0-1uta51sAzIpg7wIqUdl9AC16vYkrXZgW7AtA0,2067
5
5
  z4d_certified_devices/Certified/Adeo/LDSENK10.json,sha256=G_Z1dpeZv0kuJ9te9hsFOfdjQx-1FIFTf8F9gC5PZYA,843
@@ -397,7 +397,7 @@ z4d_certified_devices/Certified/Schneider/SOCKETOUTLET2.json,sha256=8uNLqJ7EjJRQ
397
397
  z4d_certified_devices/Certified/Schneider/Wiser2-Thermostat.json,sha256=TGQvJO6Zcovb-4jnxTkoAw2tRqHMj4TYXLvxMlQuxqk,1999
398
398
  z4d_certified_devices/Certified/Schneider/iTRV.json,sha256=Pe6vPpWTm3KgPlPZ0uKab2Ft9t6TK9L63cHCDwHHSZg,2551
399
399
  z4d_certified_devices/Certified/SmartThings/outletv4.json,sha256=VuEFunRkK5jK7C0uJNL9cs_BlQXyTJvijgHOKWLRDos,1084
400
- z4d_certified_devices/Certified/Sonoff/01MINIZB.json,sha256=q1bUVrJTtOKDg9CwiJRdYb0fGQVghsbg_Q9lRiJLTRg,617
400
+ z4d_certified_devices/Certified/Sonoff/01MINIZB.json,sha256=IUpMlaVTSDJzFa6mcS7Tv64_JURYQT8sFmpgG5LLfyA,550
401
401
  z4d_certified_devices/Certified/Sonoff/66666-motion.json,sha256=loNh4aHKInQ0v2ZPeit7bt7ViCojcJ66kEAQyGYtP7o,509
402
402
  z4d_certified_devices/Certified/Sonoff/66666-temphumi.json,sha256=K-5CmpCihD_k5w7xzcL4M4aG1ew9xjOJ_K97_1kXXdA,923
403
403
  z4d_certified_devices/Certified/Sonoff/66666.json,sha256=iN5xb24Ft3rhiwxwElRjuuQODU1os1vix7NuYQlMWz0,923
@@ -574,9 +574,9 @@ z4d_certified_devices/Certified/eWeLink/SA-003-Zigbee.json,sha256=PHqliTZ0_8a7F_
574
574
  z4d_certified_devices/Certified/eWeLink/SA-030-1.json,sha256=PHqliTZ0_8a7F_hbRVIVQ9A-sJipGrBD1jzhgkKJRvw,833
575
575
  z4d_certified_devices/Certified/eWeLink/SWITCH-ZR02.json,sha256=poSWAakR1iWJyvCXx5vgjYga38l6QYZM5C0MSk5vqas,835
576
576
  z4d_certified_devices/Certified/eWeLink/SWITCH-ZR03-1.json,sha256=poSWAakR1iWJyvCXx5vgjYga38l6QYZM5C0MSk5vqas,835
577
- z4d_certified_devices-4.259.dist-info/LICENSE.txt,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
578
- z4d_certified_devices-4.259.dist-info/METADATA,sha256=VFXZz2b3PXwySYr7_poxv5YiRLADxXrzKlQC1JuvWHg,36878
579
- z4d_certified_devices-4.259.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
580
- z4d_certified_devices-4.259.dist-info/top_level.txt,sha256=dZpL9ibb5CtTAY-pS-wGk-1jh9d-q04ogJ-Dfskashk,22
581
- z4d_certified_devices-4.259.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
582
- z4d_certified_devices-4.259.dist-info/RECORD,,
577
+ z4d_certified_devices-5.260.dist-info/LICENSE.txt,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
578
+ z4d_certified_devices-5.260.dist-info/METADATA,sha256=KMnbn34KO-_E1F1D-p6xrpocQqzjz-fJ1Cl-Ofdl39I,36878
579
+ z4d_certified_devices-5.260.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
580
+ z4d_certified_devices-5.260.dist-info/top_level.txt,sha256=dZpL9ibb5CtTAY-pS-wGk-1jh9d-q04ogJ-Dfskashk,22
581
+ z4d_certified_devices-5.260.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
582
+ z4d_certified_devices-5.260.dist-info/RECORD,,