Page 2 of 2

Re: New Bosch BME280 temperature, humidity, pressure sensor library

Posted: Tue Jul 09, 2019 6:51 am
by Hasenradball
Hi Robert,

Thanks for you support!
Just one question, please.
What is the benefit of the Property functionality?

Best regards
Frank

Re: New Bosch BME280 temperature, humidity, pressure sensor library

Posted: Tue Jul 09, 2019 7:34 am
by Roberthh
What is the benefit of the Property functionality?
That's up to you. Properties can be use to get, set and delete data of a class. For getting, there is usually almost no difference to using a function call notation. The only difference in the actual case would be writing 'bme.values()' instead of 'bme.values'. setting or deleting makes a difference, because a setter would also be transformed into a function call, than can do rather complex operations, while still looking like a simple assignment by the callee. Still that could be done with a class method call, and you may call that 'syntactic sugar'.

For the actual BME280 the benefit of using properties is minor.

Re: New Bosch BME280 temperature, humidity, pressure sensor library

Posted: Tue Jul 09, 2019 8:33 am
by Hasenradball
I tested yesterday the property call and I got an error.
Maybe my call was wrong.
But I will check it angain today.

Thanks a lot....