domschl / python-fhem

Python FHEM (home automation server) API
MIT License
15 stars 6 forks source link

Improved get functions for easier access to fhem data #10

Closed Andre0512 closed 5 years ago

Andre0512 commented 5 years ago

I integrated filter from fhem's devspec and give the probalby most used filters as parameters . Also added functions to return only states or special readings/attributes/internals.

domschl commented 5 years ago

Tx @Andre0512 , this looks like a good improvement. I will look over this during this weekend.

Andre0512 commented 5 years ago

Well, I reworked the code again and went one step further and replaced all get functions with my filter functions. Take a look at this and let me know if you think of a better naming for the functions or you want to do it with a different concept. Theoretically, a single get-function could be done and pass everything as a parameter or it could be even more differentiated into individual functions.

I also implemented a conversion to float, int, and datetime. I could not find an existing function for it and I think my solution is not the best performer, but for that purpose it should be enough, I hope.

That would have to be it then for my purpose at the moment.

Andre0512 commented 5 years ago

Tomorrow or Sunday I will ensure the compatibility with python2 and I will improve my documentation.

domschl commented 5 years ago

This look like a nice extension. Ok, let me know when you're done with the changes.

We would need:

and it would be nice, if README.md also contains some updates for the new api.

I would then review and test your changes, and prepare a new version for PyPi and regenerate the documentation from source.

Andre0512 commented 5 years ago

Okay, I'm working on it. Documentation for protected and deprecated functions is not needed, right?

Andre0512 commented 5 years ago

Done. You can start reviewing. :slightly_smiling_face:

Andre0512 commented 5 years ago

Hello, did you manage to have a look on it? Was everything fine? When do you plan to release a new version?

domschl commented 5 years ago

I am on it. Besides cosmetics, so far I have made one change to your parameter names, all nsomething parameters changed to not_something parameters for clarity. I will still need some days for a few other open issues and testing. It all looks nice!