jangxx / node-magichome

An incomplete implementation of the functionality of the "Magic Home" app. Partially a port of https://github.com/Danielhiversen/flux_led to Node.js
ISC License
124 stars 26 forks source link

New type #23

Closed renaiku closed 4 years ago

renaiku commented 4 years ago

Hello, I got a device of type 0x81 I think.

logs:

Received: 81 44 23 61 21 1f 00 00 00 fe 04 00 0f 9a 
{"type":68,"on":true,"mode":"color","speed":0,"color":{"red":0,"green":0,"blue":0},"warm_white":254,"cold_white":0}

Do you want me to run tests to check if we should add it to default mask applying ? This device has color and warm white. the magic home app is setting the cold white by changing the rgb values i think (cold white always returns 0).

jangxx commented 4 years ago

One step back please, what exactly is the problem you're having? From the data you sent, you can clearly see, that the type is 68 or 0x44 in hex, which is one of types that I recently added to the list of types which have masks applied automatically. If you want to report a problem with the library please go ahead, but right now I'm not sure what to make of your post.

renaiku commented 4 years ago

Oh ok. I thought the first byte (81) was the type in the answer of the bulb. I thought it was a new type not listed yet 😇.

jangxx commented 4 years ago

Just look at the JSON output, which contains the field "type": 68. The first byte is just the type of the response (0x81 = response to query).

renaiku commented 4 years ago

Ok perfect thanks !