PyVLCB 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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyVLCB
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: A library for CBUS / VLCB communication
5
5
  Author-email: "Stewart Watkiss (penguintutor)" <5587863+penguintutor@users.noreply.github.com>
6
6
  License: MIT License
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "PyVLCB"
7
- version = "0.2.1"
7
+ version = "0.2.2"
8
8
  description = "A library for CBUS / VLCB communication"
9
9
  readme = {file="README.md", content-type = "text/markdown"}
10
10
  requires-python = ">=3.6"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyVLCB
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: A library for CBUS / VLCB communication
5
5
  Author-email: "Stewart Watkiss (penguintutor)" <5587863+penguintutor@users.noreply.github.com>
6
6
  License: MIT License
@@ -463,14 +463,15 @@ class VLCBOpcode:
463
463
 
464
464
  Returns:
465
465
  String: shortened opcode string
466
+ or empty string for NULL opcode
466
467
 
467
- Raises:
468
- ValueError: If string does not contain at least 2 characters
469
468
  """
470
- if len(opcode_string) >= 2:
469
+ # Also ignore - in position 1 (eg. " - ")
470
+ if len(opcode_string) >= 2 and opcode_string[1] != "-":
471
471
  return opcode_string[0:2]
472
472
  else:
473
- raise ValueError(f"String {opcode_string} is too short.")
473
+ # If not a opcode_string (eg. Null) return ""
474
+ return ""
474
475
 
475
476
  # Get min priority from opcode
476
477
  @staticmethod
@@ -484,7 +485,7 @@ class VLCBOpcode:
484
485
  ValueError: If opcode not found
485
486
  """
486
487
  opcode = VLCBOpcode.opcode_extract(opcode)
487
- if opcode in VLCBOpcode.opcodes.keys():
488
+ if opcode in VLCBOpcode.opcodes:
488
489
  return VLCBOpcode.opcodes[opcode]['minpri']
489
490
  else:
490
491
  raise ValueError(f"Opcode {opcode} is not defined.")
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes