Comments (5)
I can't remember the exact motivation behind this eldritch horror, but I don't believe I use device.register.set_field()
anywhere in any library based on i2c-device.
Presumably I wanted device.some_settings_register.set_field(1)
to work, but I seem to exclusively use the pattern:
device.set("REGISTER", key=value, key2=value2)
I would be delighted to remove this ghastly abomination and patch any libraries that show otherwise. Sometimes simpler is better, and trying to do weird dictionary lookup catching nonsense liks this is just a result of nobody telling me when to stop.
from i2cdevice-python.
I'm running into this too - maybe the __dict__
signature changed or something? I haven't looked into it yet. _RegisterProxy
explains why it's there:
class _RegisterProxy(object):
"""Register Proxy
This proxy catches lookups against non existent get_fieldname and set_fieldname methods
and converts them into calls against the device's get_field and set_field methods with
the appropriate options.
This means device.register.set_field(value) and device.register.get_field(value) will work
and also transparently update the underlying device without the register or field objects
having to know anything about how data is written/read/stored.
"""
from i2cdevice-python.
I'm on board with that! Do you want to remove it, or I can open a PR?
from i2cdevice-python.
Feel free to open a PR- though Iām going to have to do some careful inspection of our i2c-device based libraries to make sure Iām not wrong
from i2cdevice-python.
Thank you gentlemen for giving your precious time to this!
Btw the script with the Pimoroni RTC breakout works perfect. Even having it left without electricity for weeks, it keeps time quit exactly.
from i2cdevice-python.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from i2cdevice-python.