sanjay900 / solution3000-home-assistant

This integration allows for connecting home assistant to a solution 2000 or 3000 panel.
10 stars 0 forks source link

if statement changed. #4

Closed xareal closed 2 years ago

sanjay900 commented 2 years ago

Really don't see a point in this. If we were going for something more optimal, then it would make more sense to use a dict or something, and we would do it in more places. But it really doesn't matter here, and tbh at some point i may just rewrite the file as it was written based on reverse engineering the android code, so its designed around android translation keys, when that sort of thing really isn't necessary here. At some point i might bother to rewrite it though.

The delays are because of the network requests, not this code being unoptimal

xareal commented 2 years ago

Ok. just practising for myself.

sanjay900 commented 2 years ago

Fair enough man, might be good to look up dictionaries and how they work, as for something like this where your wanting to tidy up what is essentially a look up table, they let you store things in a clean way and retrieve them without a for loop.

Thanks for the effort though, don't want to discourage you or anything!

xareal commented 2 years ago

Cool. I have been trying to get to a project where I can practice. But cannot seem to enter into anything. I am self-learning programming. Not from IT field.

sanjay900 commented 2 years ago

Yeah this ones probably not the best project to start from as its sorta built from reverse engineering a lot of other code, so its not the most well organized code base to work on.

Its probably best to work on something of your own to start with, as its quite difficult to learn programming just by contributing to projects i found.

I made my start by finding something i wanted to write, and then following tutorials on how to program as i worked towards that project. I think following tutorials and things is probably your best bet, but i wouldn't really have many ideas on projects to start with besides the basics like a calculator or some sort of tool that does something you need, or even a small game or something like that. It does help to have a goal in mind though cause that will help you have something to work towards and that can help when trying to learn.

xareal commented 2 years ago

Thanks for the insight. Will keep in mind.