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

Add commands for setting date and time #83

Merged
merged 1 commit into from
Jan 11, 2023
Merged

Add commands for setting date and time #83

merged 1 commit into from
Jan 11, 2023

Conversation

allenporter
Copy link
Owner

@allenporter allenporter commented Jan 11, 2023

Add separate commands for setting the date and time of the device. This requires rewriting the encoding/decoding libraries using the new sipcommand format that can specify arguments in the same format as the responses.

Fixes #57

Example command:

$ python3 examples/rainbird_tool.py --log-level=debug set_current_date 2023-01-09
DEBUG:pyrainbird.async_client:Request to line: 130917E7
DEBUG:pyrainbird.async_client:Request: {"id": 1673419656.7081575, "jsonrpc": "2.0", "method": "tunnelSip", "params": {"data": "130917E7", "length": 4}}
DEBUG:pyrainbird.async_client:Response: {"jsonrpc": "2.0", "result":{"length":2, "data":"0113"}, "id": 0}
DEBUG:pyrainbird.async_client:Response from line: 0113
DEBUG:pyrainbird.async_client:Response: {'type': 'AcknowledgeResponse', 'commandEcho': 19}
None
$ python3 examples/rainbird_tool.py --log-level=debug get_current_date
DEBUG:pyrainbird.async_client:Request to line: 12
DEBUG:pyrainbird.async_client:Request: {"id": 1673419658.5084407, "jsonrpc": "2.0", "method": "tunnelSip", "params": {"data": "12", "length": 1}}
DEBUG:pyrainbird.async_client:Response: {"jsonrpc": "2.0", "result":{"length":4, "data":"920917E7"}, "id": 0}
DEBUG:pyrainbird.async_client:Response from line: 920917E7
DEBUG:pyrainbird.async_client:Response: {'type': 'CurrentDateResponse', 'day': 9, 'month': 1, 'year': 2023}
2023-01-09

@allenporter allenporter merged commit 528bdec into main Jan 11, 2023
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

Successfully merging this pull request may close these issues.

Request to set date & time of RainBird
1 participant