-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow new format for local_key #418
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me (FWIW).
Experience the new format not being allowed in the current version of this plugin too. Would be great this could be fixed in due course. Thanks @iRayanKhan |
As I just discovered, this regex does not cover all local keys. One of my local keys failed the regex parsing, specifically it included a I modified the regex string a little, and it looks like this fixes the problem: ^[a-zA-Z0-9~`!@#$%^&*|()+={}\[\];:\'\"<>.,\/\\\?-_]+$ |
At this point it might be just better to remove this check. It seems pretty much any ASCII character can be in the key, so continuing to extend the regex is not really helping. |
+1 for merging this. I also encountered a new local key format today with both uppercase chars and special chars as well. |
Removed all checks for local_key due to variability. |
Getting this error when installing this update in my environment:
|
Hi - new here and excuse my noobness - having this issue with my Arlec ceiling fan - how do you install this fix? |
Hey! Since this isn't merged into the project yet, it'll make it harder to install. File 1: index.jsReplace this: if (!/^[0-9a-f]+$/i.test(device.key)) return this.log.error('%s, key for %s (%s), is not a valid key.', device.key.replace(/.{4}$/, '****'), device.name || 'unnamed device', device.id); With this: if (!/^[a-zA-Z0-9~`!@#$%^&*|()+={}\[\];:\'\"<>.,\/\\\?-_]+$/i.test(device.key)) return this.log.error('%s, key for %s (%s), is not a valid key.', device.key.replace(/.{4}$/, '****'), device.name || 'unnamed device', device.id) File 2: cli-decode.jsReplace this: if (!/^[0-9a-f]+$/i.test(key)) { With this: if (!/^[a-zA-Z0-9~`!@#$%^&*|()+={}\[\];:\'\"<>.,\/\\\?-_]+$/i.test(key)) { This may not work (in the future), but it's the easiest solution for you right now. It definitely solved it for me :) |
Awesome thanks for that! - now again excuse my basic skills "Keep in mind, all of these files will be located inside the homebridge-tuya folder inside node_modules." where is the node_modules folder usually found? |
If you're running homebridge on docker, you can find it by entering your container, by running these commands: docker exec -it homebridge /bin/bash
cd homebridge/node_modules/homebridge-tuya If you're running it without any complicated setup, just go into the Hope that clarifies it a bit, but feel free to let me know if you need any help! |
Thanks I'll give it a crack when I get home from work this afternoon! |
ok - did the first file - can't find the cli-decode.js file though? |
|
Likely not the place to ask this, but is there a fork of this plugin that's actually being maintained? This repo has 21 PR's, and 99 issues, and the maintainer appears to be MIA. I asked back in February if the maintainer was able to add another admin to the project to allow PR's to be merged, and releases to be made - crickets. |
Is there a mystery admin who is willing to take care of it? Someone did message me on Twitter then I didn't hear further. |
Well I managed to find and make the requested changes to the code - no local key error message after reboot but it still can't find the device. I'll put it in the too hard basket for now until there's a better fix. |
@iRayanKhan is there a chance you could merge this into the master branch and publish it. |
Good question... I sadly don't have an answer for you. I'm not knowledgable enough with Homebridge or the inner workings of this plugin to take it on myself. Perhaps one of the more active fork maintainers, or one of the more knowledgable users in this PR like @SoCuul (assuming they want to take it on)? |
I would be happy to help out, but while I'm fluent in typescript, I have little to no experience building a homebridge plug-in. I've gone over the documentation countless times, but I haven't fully got the grasp of it. |
Finally got it working thanks to some help in the discord had to add "//" in front of line 99 on the index.js and also added a line into the config.json and it finally showed up in Homebridge |
That's fair :) Sorry to call you out like that! |
A working fork till then for easy install: https://github.com/ayushsharma82/homebridge-tuya-local @iRayanKhan Feel free to pull and merge. |
I am happy to help out and try keep this plugin alive. I messaged @iRayanKhan a while back on twitter but never
That was me that reached out. I have sent a request to add you on Discord to discuss further. |
Hey @ayushsharma82, I have spoken with @iRayanKhan and got access to merge PRs into the repository with the intention to start fixing some of the issues listed. Looking at the changes you have made i am thinking it might make sense to start with merging your fork back and publishing a new version? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good to me.
Changes have been published up to NPM as version 3.1.0-beta.2. Should be available for testing on homebridge. |
* allow new format for local_key * fixup! allow new format for local_key * remove all checks for local_key
* allow new format for local_key * fixup! allow new format for local_key * remove all checks for local_key
Allow latin alphanumeric and special character for local_keyRemove local_key check
Fixes #409
Fixes #410