New Bosch BME280 temperature, humidity, pressure sensor library

Discuss development of drivers for external hardware and components, such as LCD screens, sensors, motor drivers, etc.
Target audience: Users and developers of drivers.
User avatar
Hasenradball
Posts: 13
Joined: Tue May 21, 2019 12:52 pm
Location: Germany
Contact:

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

Post by Hasenradball » Tue Jul 09, 2019 6:51 am

Hi Robert,

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

Best regards
Frank

User avatar
Roberthh
Posts: 1518
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

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

Post by Roberthh » Tue Jul 09, 2019 7:34 am

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.

User avatar
Hasenradball
Posts: 13
Joined: Tue May 21, 2019 12:52 pm
Location: Germany
Contact:

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

Post by Hasenradball » Tue Jul 09, 2019 8:33 am

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....

Post Reply