keefo / NeewerLite

NeewerLite is an un-official Neewer LED light control app for macOS.
MIT License
113 stars 9 forks source link

Neewer 660 LED (non RGB) BiColor #6

Open MarkFonts opened 2 years ago

MarkFonts commented 2 years ago

Hi! Was wondering if supporting the bicolor version to control would be doable. Thanks!

keefo commented 2 years ago

Hi Mark

yes, it should be possible. I don't have bicolor version. yet. I have put an order in Amazon. Once I get it I can try to code it in.

Regards, L

keefo commented 2 years ago

Is this the version you have? https://www.amazon.ca/Dimmable-Photography-Intelligent-Professional-3200K-5600K/dp/B07ZRLYP16?ref_=ast_sto_dp

MarkFonts commented 2 years ago

Exactly right!

taburineagle commented 2 years ago

I just added support for those in my NeewerLite-Python script - they send the commands just slightly different than the RGB ones, brightness is sent to 78 82 and color temp to 78 83 - not really sure why they opted to do that, but that's how those ones work :)

keefo commented 2 years ago

Hi @taburineagle do you know if all bi-color lights follow the same pattern or just this Neewer 660 version? I saw a Neewer 480 LED Bi-color light.

taburineagle commented 2 years ago

I'm not 100% sure on that, but I believe so - I've only been able to test those commands out with a SNL-660 so far. I'm curious if the bi-color "ring light" style lights also use those commands.

keefo commented 2 years ago

Hi @MarkFonts I published a new build v0.5: https://github.com/keefo/NeewerLite/releases/tag/0.5

Please let me know if you encounter any issue with 660 Bi-color light.

keefo commented 2 years ago

If it works, I will add SNL660 to the "Tested Lights" section.

keefo commented 2 years ago

I'm not 100% sure on that, but I believe so - I've only been able to test those commands out with a SNL-660 so far. I'm curious if the bi-color "ring light" style lights also use those commands.

I found a light type parsing logic in their Android app. Feel free to check out the code here: https://github.com/keefo/NeewerLite/blob/main/NeewerLite/NeewerLite/Model/NeewerLight.swift#L201

However, I can't tell what this type means exactly.

taburineagle commented 2 years ago

Hmm, very interesting - I wasn't aware there were so many different styles of Neewer lights 😅

One thing we do know though from testing, of the lights we've both tried, the SL-80 (lightType 6), RGB480 (lightType 3) and RGB660 PRO (also lightType 3), which are all RGB style lights, all use the 87/88/89 control scheme, and (at least) the SNL-660 (lightType 7) uses the 82/83 control scheme. It would be nice to see if there was some kind of lookup table somewhere (or maybe some sort of multiplier for the bytestring?) that corresponded to those lightType(s) listed in that code section. Maybe those are just to tell the app what capabilities each one has? One other thing I found interesting, if you try the 82/83 bytestring on an 87/88/89 style light, it won't take the command - at least not with the SL-80 and RGB660 PRO, so they're definitely different use cases.

keefo commented 2 years ago

Hmm, very interesting - I wasn't aware there were so many different styles of Neewer lights 😅

One thing we do know though from testing, of the lights we've both tried, the SL-80 (lightType 6), RGB480 (lightType 3) and RGB660 PRO (also lightType 3), which are all RGB style lights, all use the 87/88/89 control scheme, and (at least) the SNL-660 (lightType 7) uses the 82/83 control scheme. It would be nice to see if there was some kind of lookup table somewhere (or maybe some sort of multiplier for the bytestring?) that corresponded to those lightType(s) listed in that code section. Maybe those are just to tell the app what capabilities each one has? One other thing I found interesting, if you try the 82/83 bytestring on an 87/88/89 style light, it won't take the command - at least not with the SL-80 and RGB660 PRO, so they're definitely different use cases.

There is a command type SQLite database. However, I couldn't find the db in app package. I suspect, the app downloads a db file from their website API.

if (ul.getCommandType(bleDevice.getLightType()) == 2) 
{
 ....
}

public static int getCommandType(int paramInt) {
    tl tl = getConfig(paramInt);
    return (tl == null) ? 0 : tl.getCommandType();
}

public static tl getConfig(int paramInt) {
    return (tl)SQLite.select(new com.raizlabs.android.dbflow.sql.language.property.IProperty[0]).from(tl.class).where(new SQLOperator[] { (SQLOperator)vl.k.eq(Integer.valueOf(paramInt)) }).querySingle();
 }
taburineagle commented 2 years ago

Interesting, interesting - I did look at the iOS package after backing up last night, there were a few .sqlite files in it, but I think those are more just used as preference files, not application data (of course, I could be wrong...)

elbsoft commented 2 years ago

If it works, I will add SNL660 to the "Tested Lights" section.

Hi, I tested it with SNL660 and unfortunately the search does not give any feedback. Is the version of the lamp to be supported in the future?

keefo commented 2 years ago

@elbsoft please help test the searching logic. If you find out why it is not showing up, let me know, I can fix the logic. thank you.