Skip to content

Commit

Permalink
Added platform specific IO support to busylight.lights.light.Light
Browse files Browse the repository at this point in the history
  • Loading branch information
JnyJny committed Dec 3, 2024
1 parent c21db16 commit 3f66e5d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion busylight/lights/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,16 @@ def reset(self) -> None:
self.off()
self.cancel_tasks()

@property
def platform(self) -> str:
"""The operating system name."""
try:
return self._platform
except AttributeError:
pass
self._platform: str = platform.system()
return self._platform

@property
def device_id(self) -> Tuple[int, int]:
"""A tuple of integer vendor and product identfiers."""
Expand Down Expand Up @@ -538,7 +548,7 @@ def update(self) -> None:
- LightUnavailable
"""

if platform.system() == "Windows":
if self.platform == "Windows":
data = bytes([0x00]) + bytes(self)
else:
data = bytes(self)
Expand Down

0 comments on commit 3f66e5d

Please sign in to comment.