Giter Club home page Giter Club logo

happylighting-py's Introduction

Hi there ๐Ÿ‘‹

MikeCoder96's github stats

happylighting-py's People

Contributors

mikecoder96 avatar rhn19 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

happylighting-py's Issues

UWP version

there seems to be like windows version but could not found it. Also, what's the c++ / hex equivalent of controlling the led. I tried converting bytearray to hex equivalent but failed. I am trying to control the lighting via Bluetoothctl and gatt write? any help will really be appreciated.

Command-line ideas - Bitmap-fed schedule

I figured i'd just start a new thread for this that way we're not piggy backing off the other user's thread

What i've hacked together for my own purposes uses a 24x7 pixel bitmap as a color source for the lights, it then lerps the color based off the current minute - it's a pretty specific usecase, but using images as a way to encode color sequences might be a pretty intuitive way to do it.
image

Expanded
image

I'll add what I've done to implement the logic mostly to clarify the idea - but my approach to it could be considered an act of violence, I do apologize for what I've done to your code lol

pyhl.py.txt

I then call it from powershell and do the image handling there because i'm much more comfortable there.

add-type -AssemblyName System.Drawing
write-output "Loading File"
$bmp = (new-object System.Drawing.Bitmap -ArgumentList @("PathToImage"))
$now = (get-date)
$color1 = $bmp.GetPixel($now.hour%$bmp.width,[int]($now.DayOfWeek));
$color2 = $bmp.GetPixel(($now.hour+1)%$bmp.width,[int]($now.DayOfWeek));
#close
write-output ("Closing File - picking for "+([int]($now.DayOfWeek))+" : "+($now.hour%$bmp.width)+" : "+$now.minute)
$bmp.Dispose()
#quicklerp
[int]$red = (($color2.r)*($now.minute / 60.0)) +(($color1.r)*(1-($now.minute / 60.0)))
[int]$green = (($color2.g)*($now.minute / 60.0)) +(($color1.g)*(1-($now.minute / 60.0)))
[int]$blue = (($color2.b)*($now.minute / 60.0)) +(($color1.b)*(1-($now.minute / 60.0)))

write-output ("R $red G $green B $blue")
for($i = 0; $i -lt 10; $i++){
	if ((iex ("python $PSScriptRoot\pyhl.py FF:FF:FF:FF:FF:FF on "+$red+" "+$green+" "+$blue+" 2>&1") | % -begin {$result=$false }{ $result = $result -or $_.ToString().contains("was not found!");} -End {-not $result})){
		break;
	}
	write-output "Looping $i of 10"
	sleep 5	

}
write-output ("Done")
$global:ErrorActionPreference = "Continue"

Then I call that from a scheduled task that runs ever half hour throughout the day

Tutorial

Hello im very interest about the app but idk how to install it can u do a tutorial please ?

help

im struggling with this program, my device shows up in like 1/15 scans. How do I get the UUID? Tried to get it from android but thats broken too. Any help would be apreceated. Chis#8122

happy lightning module

hey is it possible to use the functions without the gui?
if not, could you maybe find a way to do it?
(I want to link my led strips to google assistant but I don't know how to use the functions without the gui and i don't know much about bluethooth ble devices)

use >>


scan()
output>
names
QHM_d51

Connect(name) #QHM_d51
Change_color(RGB value)# 255,255,255
Change_mode(MODE)


LEDS_on()
LEDS_off()


and is it possible to turn on and off the led strips with the app?

Where are the preset pattern defined

Hi,

I would like to create a new preset (pulsating green/purple) as a training but i do not find where the presets are defined. I am not used to python and this kind of coding.

Thank you

issuses reporting

after using this program for a while, i wanted to share some bugs that i want to report

  • in linux, i had to remove the from ctypes import windll and all its references (line 359 and 360) from pyhl.py
Traceback (most recent call last):
  File "/home/golden/Desktop/HappyLighting-py-master/LEDStripController/pyhl.py", line 18, in <module>
    from ctypes import windll
ImportError: cannot import name 'windll' from 'ctypes' (/usr/lib/python3.11/ctypes/__init__.py)
  • if a device is already connected to the pc, when the program is scanning for devices, the connected device isn't showing up
  • when sliding the speed slider when it isn't in a compatible mode, the program crashes
Traceback (most recent call last):
  File "/home/golden/Desktop/HappyLighting-py-master/LEDStripController/pyhl.py", line 242, in changeSpeed
    if isModeUsed:
       ^^^^^^^^^^
NameError: name 'isModeUsed' is not defined
  • when selecting both the local mic and the device mic the program crashes (some times) (i suggest to replace the checkboxes with radio buttons)

New program

I just discovered your wonderful repository and I saw that it's a little hard to use
since it doesn't have requirements file and it's built with visual studio.

So I created new program with similar functionality
refactored the code
With very lightweight app that can work on Windows / Linux / Mac
There's already release for windows
https://github.com/thewh1teagle/happy

Create Custom Sequences

I would love to be able to create my own sequences of pulsing and jumping with custom colors.

I could even help with the code, but would need a walk through of how the actual commands to the device work.

Connect button not working

The connect button does nothing when pressed, I tried restarting, uninstalling the official app, and updating bleak,
Is there anything that I'm missing?

Bleak error

Hello, i'm having trouble when scanning, got this error :

libpng warning: iCCP: known incorrect sRGB profile
Traceback (most recent call last):
  File "C:\Users\Tatane\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\qasync\__init__.py", line 780, in _error_handler
    task.result()
  File "C:\Users\Tatane\Downloads\HappyLighting-py-master\LEDStripController\pyhl.py", line 284, in handle_scan
    devices = await BLEClass.BleakScanner.discover(timeout=8.0)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Tatane\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\bleak\__init__.py", line 320, in discover
    async with cls(**kwargs) as scanner:
  File "C:\Users\Tatane\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\bleak\__init__.py", line 158, in __aenter__
    await self._backend.start()
  File "C:\Users\Tatane\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\bleak\backends\winrt\scanner.py", line 222, in start
    assert_mta()
  File "C:\Users\Tatane\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\bleak\backends\winrt\util.py", line 78, in assert_mta
    raise BleakError(
bleak.exc.BleakError: The current thread apartment type is not MTA: STA. Beware of packages like pywin32 that may change the apartment type implicitly.

Feature requests

after using this program for a while, i wanted to share some features that i propose:

  • #21
  • when scanning for devices it show a loading icon
  • when closing the program it auto disconnects the connected device
  • #20

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.