Giter VIP home page Giter VIP logo

magichome-python's People

Contributors

adamkempenich avatar fabaff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar

magichome-python's Issues

Initiation not working

In the readme file, it is writen to use the MagicHomeAPi() method, which isn't defined. Shouldn't it be the __init__() method instead?

For __init__(self, device_ip, device_type, keep_alive=True), what am I suposed to enter for self and keep_alive=True?

UPDATE: Sorry, I never worked with Python before. I found the solution for my problem now

socket.error : timed out

I continue to get the socket.error when trying to do anything with the bulb

import MagicHomeApi

bulb = MagicHomeApi.MagicHomeApi('xx.xx.x.xxx',2)

bulb.get_status()

Establishing connection with the device.
Caught exception socket.error : timed out
Traceback (most recent call last):
File "c:\Users\User\Documents\Code\Python\MagicHome\DemoBulb", line 6, in
Caught exception socket.error : [Errno 9] Bad file descriptor
bulb.get_status()
File "c:\Users\User\Documents\Code\Python\MagicHome\MagicHomeApi.py", line 50, in get_status
return self.s.recv(15)
File "C:\Python27\lib\socket.py", line 174, in _dummy
raise error(EBADF, 'Bad file descriptor')
socket.error: [Errno 9] Bad file descriptor

Unable to change RGB color on type 0 lights (I can turn them on and off)

Hello there. I have type 0 lights, normal RGB light strips with the magic home wifi controller. I'm running the API through Visual Studio just as a test as I'm trying to do bigger and better things with it once I get it working. I'm able to turn the lights on and off thanks to a comment from another issue that solved my issue of them not turning off or on (Change to if self.device_type <= 1:). Now I'm running into an issue with the RGB request not working. This is my code:
`import time

from MagicHomeAPI import MagicHomeApi

controller1 = MagicHomeApi('192.168.0.142',0)

controller1.get_status()

controller1.turn_on()

controller1.update_device(0,255,255)
If I check the path of controller1.update_device(0,255,255) in visual studio it returns:(method) update_device: (r=0, g=0, b=0, white1=None, white2=None) -> None`
I don't even know where to start on this one as I've looked over update_device and I can't see how the variables are not reaching message = [0x31, r, g, b, white1, 0x00, 0x0f]. I would appreciate the help, thank you.

Btw, I'm also using Python 3.8.10, hints the need for changing the self.device_type to <=1:.

Stripe fading while colorChange

When I use the update_device command, my led stripes switch color, but they are just fading. So could you pease change/add the function that it jumps directly to that specific color, just like in jumpColor mode (or however it is called)

I hope I'll get a Reply soon, even if this Api is a bit older...

Greetings Felix

Edit: I would also liike to know if you are working on the "tasks" from the main page or if this project is like more´or less completely dead.

Unable to update RGB light status with Type 3

So I cloned the repo, was able to get the connection working between lights.
I have been able to turn the lights on and off. However, I am unable to set the RGB lighting with the color numbers.
I am able to set the white hue from 'soft' to 'cool'.

So what am I doing wrong.

sample code:
from magichome import MagicHomeApi
controller1 = MagicHomeApi('XXX.XXX.XXX.XXX',3,True)
controller1.get_status()
output: b'\x815#a\x01\x01\x00\x00\x00\x00\x07\xf0\x0fB'
controller1.update_device(0,0,255)
result: 'Cool' white light appears.

Any thoughts?

Decoding status

Hello,
how can i decode the response of the get_status function?

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.