-
Notifications
You must be signed in to change notification settings - Fork 582
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
One device only #32
One device only #32
Conversation
Would it be possible for you to extract the unrelated stuff, I.e. everything related to I just glanced quickly and one thing I noted is that the import part is not done right. The |
Well I thought a lot how to do it but in my head it's quite not feasible, because moving TuyaCache goes together with the config file refactoring (at least, in my head). I could try but I'd need more time.
This cannot happen, since each entity has local_deviceId**_entityDpsId** as unique ID, so different entities always have different unique IDs. |
Just extracting the class from each platform to
I believe I wasn't clear enough here. I was referring to the unique id of the config entry itself, not the entities defined within the config entry. EDIT: This id is of course the same as the device id. |
OK then, let me try to split this PR in two parts so that we can figure out how to fix it. |
Sounds great! I have prepared a commit to introduce supports for reloading config from YAML without restarting home assistant, but I need this PR to be finished before I can finish that though. |
OK @postlund , I split this PR into #38, which I have already merged since -as you correctly said- it was only a matter of moving code here and there and everything remained functional (fan and light still untested, though). |
I will have a look! Can you rebase this on top of |
Sure, how should I do that? Don't want to mess things around this time... should I just launch |
Avoid merges first hand, you could just try |
Now this is THE big change, and it needs thorough testing and fixing for sure.
Plus, it is incomplete and @postlund I need your help because my brain hurts but still I could not get Options schemas default. I had to comment out a couple of lines in _convert_entity , please help me with this because the whole Schema thing is still a bit awkward to me. (I had to hardcode the options params for my cover to work).
Oh, and I also had to comment a couple of references of the update_listener because it made this fail to start so it has to be restored as well, sorry about this (did not understand what's going wrong and my head aches very badly 😆 ).
Plus, it should be adapted to config_flow (not tested).
One thing to be noted is that now the pytuya class is called TuyaInterface, while TuyaCache has been moved to init and renamed as TuyaDevice. Next step will be for TuyaDevice to introduce persistent connection.
Here is the new YAML format (very sleek!):
@postlund please help fixing this, I don't know whether it's better to merge this for now so you can work on a PR of your own, please advice, thank you!