Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read & export all data in 0.6.2 #41

Open
chinezbrun opened this issue Jun 26, 2022 · 0 comments
Open

Read & export all data in 0.6.2 #41

chinezbrun opened this issue Jun 26, 2022 · 0 comments

Comments

@chinezbrun
Copy link

chinezbrun commented Jun 26, 2022

Hi,

In previous versions 0.4.0, was possibility in python to extract all data from Mate3 and export in a JSON file.
The code was like this:

from mate3.api import mate3_connection
from mate3.parsers import ChargeControllerParser, ChargeControllerConfigurationParser
from mate3.base_structures import Device
import json
import time

with mate3_connection ('192.168.0.150') as client:

blocks = client.all_blocks()

block_dicts = [b._asdict() for b in blocks]
for block_dict in block_dicts:
    block_dict['device'] = block_dict['device'].name

print(json.dumps(block_dicts))
file = open("mate3allblocks.json","w")
file.write(json.dumps(block_dicts))
file.close()

Do we have something similar in 0.6.2 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant