Apollon77 / daikin-controller-cloud

Connect and Control Daikin Cloud devices
MIT License
98 stars 25 forks source link

Migrate the lib to TypeScript #84

Closed ThibautTrarbach closed 3 months ago

ThibautTrarbach commented 2 years ago

Is your feature request related to a problem? Please describe. No my feature request does not come from a problem

Describe the solution you'd like Switching the lib to TypeScript

Describe alternatives you've considered I don't really have an alternative. My goal is to make the lib nullsafe to add other functionality later

Additional context To be honest, I'm not really asking for a job from you. My goal is to know if it is useful for me to take the time to offer you a PR allowing you to migrate to TypeSafe. As well as adding the definition of the 5 gateways that I have already been asked for on my side.

And in a more or less near future, I thought that I could have a system for updating internal values with events

The real job I would ask is proofreading, because unfortunately I'm not perfect yet and I still have to learn about languages and their possibilities.

Ps: Excuse me for my English, it's another subject or unfortunately I'm useless. Thank you Google Translate

Apollon77 commented 2 years ago

Hi,

I will be happy about a PR that convets the code base to Typescript. As I started the project it was way to experimental and typescript would have hindered me in trying stuff out with the communizty (because I myself do not have such a device at all). But yes it is the next logical step :-)

I would like to keep the generated JS version compatible to the current one if possible.

I do not know if we ever get it typesafe and nullsafe because in fact we just "reverse engineer" an external API which is not documented and not published and so Daikin can change anything anytime ... So any types are just correct unless Daikin changes something, so we also should consider this! SO maybe use partials or such, because else we need to get infos on any little change and need to update the typings for users to use it. I know this from several other projects ... So do not expect 100% accuracy for the future and please design the types in that way!

Also adding the currently known 5 gateways is a great idea. Cool - then you have more insights then I have :-) In which projects you plan to use the library (just for my personal interst :-) )

I also have just basic TS knowledge and have some TS "pro's" in my back hand ... so we will get professional feedback if you like :-)

Ingo

ThibautTrarbach commented 2 years ago

Hello, Thank you for your answer, I was just thinking of making a definition file allowing an app using ts to be able to understand it. I didn't think I would touch the current database with all the useful information.

I also tell you that I am currently in contact with Daikin to see if there is a way to have a real API that we could use in the lib.

Ps: Thank you for the help, as a student it will allow me to improve

Cordially Thibaut

Apollon77 commented 2 years ago

Contact to Daikin? Cool ... I tried that several times in the last years and never got any response :-(

But be careful ... It is easy for them to shut us down!

ThibautTrarbach commented 2 years ago

Yes, I know it's easy to shut us up. I did not indicate the direct git but the Home Assistant and Jeedom forum posts.

To contact them, I have the chance to have an acquaintance working at the French head office (Commercial)

I would also find it a pity that it limits the possibilities. Because it would make them lose market share.

Feedback that I have had is that for them it was complicated today because it would take an intermediate server. Which I'm not for.

Cordially Thibaut

Apollon77 commented 1 year ago

Why closed? It can still be left open until someone finds time

jacoscaz commented 3 months ago

@Apollon77 this one can be closed now.