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

Parser for float fails for GetCompositeSchedule action #217

Closed
laysauchoa opened this issue Jun 15, 2021 · 1 comment · Fixed by #218
Closed

Parser for float fails for GetCompositeSchedule action #217

laysauchoa opened this issue Jun 15, 2021 · 1 comment · Fixed by #218
Assignees
Labels
bug Something isn't working

Comments

@laysauchoa
Copy link
Contributor

The following parser condition does not work properly:

https://github.com/mobilityhouse/ocpp/blob/master/ocpp/messages.py#L220-L222

One can reproduce with the following test:

def test_validate_get_composite_profile_payload():
    message = CallResult(
        unique_id="1234",
        action="GetCompositeSchedule",
        payload={
            'status': 'Accepted',
            'connectorId': 1,
            'scheduleStart': '2021-06-15T14:01:32Z',
            'chargingSchedule': {
                'duration': 60,
                'chargingRateUnit': 'A',
                'chargingSchedulePeriod': [
                    {
                        'startPeriod': 0,
                        'limit': 15.2
                    }
                ]
            }
        })

    validate_payload(message, ocpp_version="1.6")
@laysauchoa laysauchoa added the bug Something isn't working label Jun 15, 2021
@laysauchoa laysauchoa self-assigned this Jun 15, 2021
@laysauchoa laysauchoa changed the title parse_float=decimal.Decimal fails for GetCompositeSchedule Parser for float fails for GetCompositeSchedule action Jun 15, 2021
@laysauchoa
Copy link
Contributor Author

This closes this issue #218

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

1 participant