Skip to content

Commit

Permalink
fixed plugin name in build.py, removed pillow install from build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
gitagogaming committed Jun 20, 2024
1 parent 216795a commit 12db98b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ jobs:
run: |
python3 -m pip install --upgrade pip
pip3 install pyinstaller
pip install pillow
pip3 install -r "requirements.txt"
- name: Build tpp using tppbuild
Expand Down
2 changes: 1 addition & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"""
PLUGIN_MAIN: This lets tppbuild know where your main python plugin file is located so it will know which file to compile.
"""
PLUGIN_MAIN = "main.py"
PLUGIN_MAIN = "wizlight.py"

"""
PLUGIN_EXE_NAME: This defines what you want your plugin executable to be named. tppbuild will also use this for the .tpp file in the format:
Expand Down
19 changes: 0 additions & 19 deletions tp_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,7 @@
PLUGIN_NAME = "WizLight"
PLUGIN_FOLDER = "WizLight"

import socket
import ipaddress

def get_broadcast_address():
# Create a socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

# Connect to a remote server
s.connect(("8.8.8.8", 80))

# Get the local IP address
local_ip = s.getsockname()[0]

# Calculate the broadcast address
ip_interface = ipaddress.ip_interface(f"{local_ip}/24")
broadcast_address = ip_interface.network.broadcast_address

return str(broadcast_address)

print(get_broadcast_address())
TP_PLUGIN_INFO = {
'sdk': 6,
'version': __version__, # TP only recognizes integer version numbers
Expand Down
20 changes: 20 additions & 0 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,23 @@ def get_ip_key(wizlight):
except Exception as e:
g_log.error("Error writing to JSON file: " + str(e))
return False


# import socket
# import ipaddress

# def get_broadcast_address():
# # Create a socket
# s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

# # Connect to a remote server
# s.connect(("8.8.8.8", 80))

# # Get the local IP address
# local_ip = s.getsockname()[0]

# # Calculate the broadcast address
# ip_interface = ipaddress.ip_interface(f"{local_ip}/24")
# broadcast_address = ip_interface.network.broadcast_address

# return str(broadcast_address)

0 comments on commit 12db98b

Please sign in to comment.