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

ChangeAvailabilityPayload incorrect? #147

Closed
danielbons opened this issue Oct 28, 2020 · 1 comment · Fixed by #148
Closed

ChangeAvailabilityPayload incorrect? #147

danielbons opened this issue Oct 28, 2020 · 1 comment · Fixed by #148
Labels
bug Something isn't working

Comments

@danielbons
Copy link

According to the OCPP 1.6 manual:

A ChangeAvailability.req should include the connector ID and an AvailabilityType while the response from the Charging Station should include AvailabilityStatus. See image below

ocpp_change_availability

The file ocpp/v16/call.py contains:

@dataclass
class ChangeAvailabilityPayload:
    connector_id: int
    type: AvailabilityStatus

And ocpp/v16/call_result.py contains:

@dataclass
class ChangeAvailabilityPayload:
    status: AvailabilityStatus

AvailabilityStatus an AvailabilityType is defined in ocpp/v16/enums.py as follows

class AvailabilityStatus(str, Enum):
    """
    Status returned in response to ChangeAvailability.req.
    """

    accepted = "Accepted"
    rejected = "Rejected"
    scheduled = "Scheduled"


class AvailabilityType(str, Enum):
    """
    Requested availability change in ChangeAvailability.req.
    """

    inoperative = "Inoperative"
    operative = "Operative"

When checking the references for AvailabilityStatus and AvailabilityType, I noticed that AvailabilityType is never referenced while AvailabilityStatus is referenced in both call.py and call_result.py as described above. Shouldn't ChangeAvailabilityPayload be as follows?

@dataclass
class ChangeAvailabilityPayload:
    connector_id: int
    type: AvailabilityType
@OrangeTux
Copy link
Contributor

Thanks! You're right, it's a bug.

@OrangeTux OrangeTux added the bug Something isn't working label Oct 28, 2020
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.

2 participants