Skip to content
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

Explore ways to decrease maintenance burden #781

Open
CloCkWeRX opened this issue Mar 31, 2022 · 8 comments · May be fixed by #1928
Open

Explore ways to decrease maintenance burden #781

CloCkWeRX opened this issue Mar 31, 2022 · 8 comments · May be fixed by #1928

Comments

@CloCkWeRX
Copy link

CloCkWeRX commented Mar 31, 2022

There's a lot of PRs backed up, and a really interested community. That can be a bit tricky as an open source maintainer when pressed for time.

Previously: #264 discussed a bit of these things

Starting a general discussion for ideas around how contributions can be of a high quality and generally safe to merge, or how others can help with triage, etc.

Things that have worked in previous projects for me:

Flip to github org + teams?

Risk: HACS links break?

Maybe - 3x good PRs, bump up people to a contributor status?

A dev vs mainline branch, with core contributors controlling releases, but casual contributors able to merge to Dev?

More templates and automation

When is this closable?

Recommend closing this if a few of the PRs seem useful and are adopted; or if it sits with no activity for ~3 months.

@CloCkWeRX
Copy link
Author

@postlund @ultratoto14 @rospogrigio - just putting this one out there as a continuation of some of your previous convos.

@EnsignR
Copy link

EnsignR commented May 21, 2022

I'd just like to chime in here to back you up a bit.

Currently there are 397 open issues and 44 open pull requests. Seems like a mountain of work for the maintainers to get on top of, and it seems likely that it's only get worse without any changes.

I've only just come to HA in the past few days and there is a mountain of information to get your head around trying to get everything working.

It's quite difficult to find solutions specific to localtuya on the community.homeassistant.io forums; you're never really sure whether posts are about the included cloud based integration or this one. I think adding a discussion forum here might enable the community to help each other out with configuration and other problems.

This may have the added effect of reducing the amount of issues posted. It's quite likely that many (posted) issues aren't really (code related) issues at all, but rather problems with individual setup.

Even this post demonstrates an issue that really is a discussion.

As another example I discovered (IMHO) a much simpler way of discovering DP IDs for your device using the Tuya IoT Platform website (that afaik you still need to use to find your keys anyway), but there wasn't really anywhere to raise it here. I posted to the community.ha.io forum, but it's been buried under configuration guides. I think it would be great to add it to the Wiki pages here, but is that really an "issue"???

BTW /v1.1/devices/{device id}/specifications is the cloud API call that shows you the DPs.

Speaking of the Wiki, the biggest problem facing localtuya, as I see it, is lack of documentation. Humble brag; I've got a Masters in Eng / Computer Science, but I'm doing my head in trying to figure out how to get all this setup, mostly due to a lack of documentation. eg. I have nfi where the localtuya.yaml is or even goes. I don't seem to have one and yet I have three devices set up and partially working. 🤷‍♂️

@rospogrigio
Copy link
Owner

Hi @EnsignR , thank you for your interest in localtuya and suggestions.
Just wanted to inform you that recently I've been working on a big change for localtuya, and will come out for a bug release (4.0.0) shortly, when I've had enough time to document it properly. 4.0.0 will introduce the cloud API calls, and the possibility to retrieve the local keys of the device from the cloud so there'll be no need to copy-paste them any more. This also opens to some more possibilities.
Also, I am discontinuing YAML configuration (it's being discouraged and deprecated everywhere in HA) so the integration will need to be configured via config flow only.
If you feel like trying it you can find it here: #829 . It' pretty stable and I'm using it in my main HA instance.
Bye!

@EnsignR
Copy link

EnsignR commented May 25, 2022

Hi @rospogrigio, thanks for the reply.

I've checked out #829 I was having trouble with the credentials and I couldn't figure out "WHYYYYYYY"` 😉
... until I almost accidentally stumbled across img/8-user_id.png

It discovered my 3 devices (Aldi/Cocoon LED strips) correctly so no need to look up the keys.

However after selecting the DPs it goes back to the previous dialog, but the previous dialog but the selection has reverted back from light to switch.

I missed changing this on one occasion and consequently deleted the device, but but could not re-add it.

`Logger: custom_components.localtuya.pytuya
Source: custom_components/localtuya/pytuya/init.py:247
Integration: LocalTuya (documentation, issues)
First occurred: 7:45:47 PM (5 occurrences)
Last logged: 7:54:12 PM

[605...471] Failed to get status:
[605...497] Failed to get status:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/asyncio/locks.py", line 413, in acquire
await fut
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.9/asyncio/tasks.py", line 492, in wait_for
fut.result()
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/config/custom_components/localtuya/pytuya/init.py", line 539, in detect_available_dps
data = await self.status()
File "/config/custom_components/localtuya/pytuya/init.py", line 481, in status
status = await self.exchange(STATUS)
File "/config/custom_components/localtuya/pytuya/init.py", line 460, in exchange
msg = await self.dispatcher.wait_for(seqno)
File "/config/custom_components/localtuya/pytuya/init.py", line 247, in wait_for
await asyncio.wait_for(self.listeners[seqno].acquire(), timeout=timeout)
File "/usr/local/lib/python3.9/asyncio/tasks.py", line 494, in wait_for
raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError`

As you'd probably expect rebooting the pi resolved this, and I've even got RGB and effect (aka "scene" by my device) selection working*, which were not previously. 😁

  • the effect names not match the device and this is something that is retrievable from calls to the API

@EnsignR
Copy link

EnsignR commented May 25, 2022

In relation to the original point raised in this "issue".

Are you planning to roll in any of the current open issues or PRs into the new build?

Cheers

@rospogrigio
Copy link
Owner

In relation to the original point raised in this "issue".
Are you planning to roll in any of the current open issues or PRs into the new build?

Well, first of all the authors of the PRs will need to merge the new version and make sure everything still works (as I expect, but I wouldn't be suprised if conflicts hard to solve would arise).
Then yes, if someone will ask to merge a PR I will have a look at it and eventually merge it, just I can't ensure timings because my workload is quite variable so there are periods in which I have time for this and periods in which I'm too full.
Consider that before merging anything I test it for some time on my personal HA because I don't want it to stop working in the first place 😉

@CloCkWeRX
Copy link
Author

To open the discussion up here further: the current buy me a coffee link has a max? Of 25 eur.
Consider what it would mean with a larger grant or funding option - what would it look like if you could spend a week on the project at full time funding?

I realise that right now there are not a large number of supporters via that specific mechanism, but what would it look like if a bug report had an open bounty?

Going down this path should not obligate anyone to anything. But 25x users being able to throw a few bucks at a common problem, and that helps prioritise it?
Perhaps worth exploring.

@rospogrigio
Copy link
Owner

Well, first of all for your generous contribution that went beyond any imagination... really appreciate it.
Going to your proposal, well it's not a matter of money, this is an open source community after all so I would not confuse appreciation-ware with pay-per-coding. Also, I could never spend a week full time because I have a job (which donations could never compete with) and I am maintaining this in my free time. The main issues for speeding up development are:

  1. the biggest: time. Free time is a rare resource, there are periods in which my workload is lighter so I can do something here and there and others where I'm too full to even think of something else. Also, I'm quite a slow coder because I'm actually a C++ developer so I feel really slow in writing and -even more- debugging this code. I finally manage to do it, but it takes time. If anybody wants to propose as a coder I'll be happy to let him join the crew.
  2. testability. I don't own many devices, I just have some switches and some covers in my house, and that's all. I read that now some devices are coming out with 3.4 protocol but I have no device like this so it's impossible to code or test it, I can only wait for some developer to raise a PR and trust it works.
  3. again, stability. When I merge some code I feel a bit responsible for what I'm publishing. So, when someone proposes a PR, I just can have a look but sometimes I must trust that it works, or ask for feedbacks from other users before merging, because I'd like to guarantee some sort of stability. Moreover, there is Rule #0 to follow: any PR must not break my configuration, of course 😆

So, this is the scenario actually. I can tell you that when a discussion or a PR gets quite animated (and there were a few) I eventually found the time to follow it and merge the work. For others, people just need to send some reminders and if I can find the time I can follow up with pleasure.
Thank you again, have a nice weekend!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants