Skip to content

Commit

Permalink
fix: fixed problem with waiting for a response for commands that retu…
Browse files Browse the repository at this point in the history
…rn none
  • Loading branch information
UpDryTwist committed Dec 12, 2024
1 parent 42ef4f0 commit 1720f55
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.bumpversion]
current_version = "0.1.1-dev12"
current_version = "0.1.1-dev13"
parse = """(?x)
(?P<major>0|[1-9]\\d*)\\.
(?P<minor>0|[1-9]\\d*)\\.
Expand Down
48 changes: 48 additions & 0 deletions coolledx/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,14 @@ def get_command_raw_data_chunks(self) -> list[bytearray]:
bytearray(self.hardware.cmdbyte_showicon().to_bytes(1, byteorder="big"))
]

@staticmethod
def expect_notify() -> bool:
"""
Should we expect a notification from the device?
This only applies to commands that send data.
"""
return False


class InvertDisplay(Command):
"""Invert the display"""
Expand All @@ -350,6 +358,14 @@ def get_command_raw_data_chunks(self) -> list[bytearray]:
)
]

@staticmethod
def expect_notify() -> bool:
"""
Should we expect a notification from the device?
This only applies to commands that send data.
"""
return False


class InvertOrSomething(Command):
"""Mirror the display"""
Expand All @@ -361,6 +377,14 @@ def get_command_raw_data_chunks(self) -> list[bytearray]:
)
]

@staticmethod
def expect_notify() -> bool:
"""
Should we expect a notification from the device?
This only applies to commands that send data.
"""
return False


class StartupWithBatteryLevel(Command):
"""Startup with battery level"""
Expand Down Expand Up @@ -391,6 +415,14 @@ def get_command_raw_data_chunks(self) -> list[bytearray]:
bytearray(self.hardware.cmdbyte_powerdown().to_bytes(1, byteorder="big"))
]

@staticmethod
def expect_notify() -> bool:
"""
Should we expect a notification from the device?
This only applies to commands that send data.
"""
return False


class SetMode(Command):
"""Set the text movement style for the scroller"""
Expand All @@ -405,6 +437,14 @@ def get_command_raw_data_chunks(self) -> list[bytearray]:
bytearray.fromhex(f"{self.hardware.cmdbyte_mode():02x} {self.mode:02X}")
]

@staticmethod
def expect_notify() -> bool:
"""
Should we expect a notification from the device?
This only applies to commands that send data.
"""
return False


class SetMusicBars(Command):
"""Set music bars: 8 bars of height (byte), each with a color from 1-7"""
Expand All @@ -429,6 +469,14 @@ def get_command_raw_data_chunks(self) -> list[bytearray]:
)
]

@staticmethod
def expect_notify() -> bool:
"""
Should we expect a notification from the device?
This only applies to commands that send data.
"""
return False


class SetText(Command):
"""Set the text to display"""
Expand Down
18 changes: 9 additions & 9 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "coolledx"
version = "0.1.1-dev12"
version = "0.1.1-dev13"
description = "Driver for the CoolLEDX LED signs (signs managed by CoolLED1248 app)"
authors = ["UpDryTwist <[email protected]>"]
license = "MIT"
Expand All @@ -11,7 +11,7 @@ keywords = ["coolled", "coolledx", "led", "sign", "coolled1248"]

[project]
name = "coolledx"
version = "0.1.1-dev12"
version = "0.1.1-dev13"
description = "Driver for the CoolLEDX LED signs (signs managed by CoolLED1248 app)"
readme = "README.md"
license = "MIT"
Expand Down

0 comments on commit 1720f55

Please sign in to comment.