Skip to content

Commit c5ebda2

Browse files
author
James Boulton
committed
update for deviceView ctrlUItapColor
1 parent 059a430 commit c5ebda2

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

dashio/iotcontrol/control.py

+2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ def _get_icon(icon_str: str) -> Icon:
3939

4040
def _get_color_str(color: str | Color) -> str:
4141
if isinstance(color, str):
42+
if color == '':
43+
return color
4244
if color[0] == '#':
4345
return color
4446
if isinstance(color, Color):

dashio/iotcontrol/device_view.py

+2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def __init__(
4747
control_background_transparency: int,
4848
num_grid_columns: int,
4949
num_grid_rows: int,
50+
user_tappable_color: Color | str = ''
5051
) -> None:
5152
super().__init__(control_id, title, control_position=None, title_position=None)
5253
self.cfg["iconName"] = icon_name.value
@@ -73,6 +74,7 @@ def __init__(
7374
raise ValueError("Value must be in the range 0 to 100")
7475
self.cfg["gridColumns"] = num_grid_columns
7576
self.cfg["gridRows"] = num_grid_rows
77+
self.cfg["ctrlUItapColor"] = _get_color_str(user_tappable_color)
7678

7779
@classmethod
7880
def from_dict(cls, cfg_dict: dict):

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@
1818
license="MIT",
1919
classifiers=["Programming Language :: Python :: 3.8", "Operating System :: OS Independent"],
2020
install_requires=["paho-mqtt>=2.0.0", "pyzmq", "python-dateutil", "zeroconf", "shortuuid", "pyserial", "astral", "pydantic"],
21-
python_requires='>3.7.0',
21+
python_requires='>=3.8.0',
2222
scripts=['utilities/c64_encode', 'utilities/c64_decode'],
2323
)

0 commit comments

Comments
 (0)