Comments (2)
Thanks for looking into this and the PR @rrooggiieerr - I'll try to look in the next few days. If I remember correctly, what you want is something like this
--set single_phase_radian_inverters[2].config.aux_control="RadianInverterConfigurationModel.aux_control.options['On']"
or (possibly equivalently)
--set single_phase_radian_inverters[2].config.aux_control="client.devices.single_phase_radian_inverters[2].config.aux_control.field.options['On']"
Just a note though - as per the readme, it's encouraged to use the Python API for writing if you can, as this one isn't great given the eval
etc. Edit - just realised you've already tried the API = )
Are there just some imports missing and is the way it was intended to work, or should I do something else?
I'm not sure - what errors are you getting? If the first one fails due to RadianInverterConfigurationModel
not being found (which, looking at it, seems likely) then that might be a case for a star import in main.py
.
Generally, if you've got ideas to make it better, let me know (or submit a PR!) - the main problem is there's just such a large number of different fields and devices, and when coupled with enums, values just get pretty long.
from mate3.
@kodonnell I'm aware of the eval
in the CLI, how about extending FieldValue
with the possible options for that field. These options can then be referred to when setting the field value.
like
field = get_field(client.devices, attr_idx_pattern.findall(path))
value = field.options[value]
field.write(value)
The argument to the CLI to set a field would then become
--set single_phase_radian_inverters[2].config.aux_control=On
from mate3.
Related Issues (20)
- All "N/A" ports, and no devices appearing in mate3_write --list-fields other than Mate HOT 3
- OutBack System Control Block - zero value for some registries HOT 1
- client.read() - help needed HOT 10
- Developer docs HOT 3
- Bugs in some Outback fields?
- On write, fields are still marked as dirty HOT 2
- Clearer outputs for different field types in the CLI and in a JSON export HOT 7
- Use native int to_bytes / from_bytes instead of FixedInt HOT 1
- Add pytest running as part of Github PRs etc. HOT 1
- Store raw registers in field value
- Tidy up the use of `raw_value`
- export to json not working HOT 2
- [question] Performance Speed HOT 3
- Use pymodbus decoding
- can not get cli to run HOT 5
- Poetry install error
- Using the library (enhancement)
- Read & export all data in 0.6.2
- Mate3Parser sched_x_ac_mode - disabled mode can not be set HOT 14
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 mate3.