Skip to content

Commit

Permalink
Win dependencies, comments
Browse files Browse the repository at this point in the history
  • Loading branch information
infeeeee committed Sep 21, 2024
1 parent 4dc7f18 commit 9b835da
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 5 additions & 2 deletions IoTuring/Entity/Deployments/Brightness/Brightness.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def AllowMultiInstance(cls) -> bool:


class Brightness_Macos(BrightnessCmds):
# TODO needs to be tested
def __init__(self) -> None:
super().__init__(
scale=1,
Expand All @@ -102,6 +103,8 @@ def CheckPlatformSupported(cls) -> None:


class Brightness_Win(BrightnessCmds):
# TODO needs to be tested
# TODO support multiple monitors
def __init__(self, monitor_id: int = 0) -> None:
super().__init__()

Expand All @@ -124,7 +127,7 @@ def _GetValue(self) -> str:
def CheckPlatformSupported(cls) -> None:
if ["wmi", "pythoncom"] not in sys.modules:
raise Exception(
"Brightness not available, have you installed 'wmi' on pip ?"
"Wmi or Pythoncom package missing"
)


Expand Down Expand Up @@ -253,7 +256,7 @@ def ConfigurationPreset(cls):
default=gpus[0]
)
else:
# Set hidden default value, if only one gpu:
# Set default value, if only one gpu, hidden question:
preset.AddEntry(
name="which GPUs backlight you want to control?",
key=CONFIG_KEY_GPU,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ TerminalButton:
icon: mdi:console
custom_type: button
Brightness.*command:
# command_topic for OFF command only:
# https://www.home-assistant.io/integrations/light.mqtt/#brightness-without-on-commands
command_topic_key:
- brightness_command_topic
- command_topic
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ dependencies = [
"InquirerPy",
"PyObjC; sys_platform == 'darwin'",
"IoTuring-applesmc; sys_platform == 'darwin'",
"tinyWinToast; sys_platform == 'win32'"
"tinyWinToast; sys_platform == 'win32'",
"pywin32; sys_platform == 'win32'",
"wmi; sys_platform == 'win32'"
]

[project.optional-dependencies]
Expand Down

0 comments on commit 9b835da

Please sign in to comment.