Fix enum checking

This commit is contained in:
wqy
2022-09-17 18:02:48 +08:00
parent 4350b5d19e
commit 391ea0386c
2 changed files with 2 additions and 2 deletions

View File

@@ -135,7 +135,7 @@ def set_tank_vol_curve(name: str, id: str, vol_curve: str) -> ChangeSet:
def set_tank_overflow(name: str, id: str, overflow: str) -> ChangeSet:
if overflow is not OVERFLOW_YES or overflow is not OVERFLOW_NO:
if overflow != OVERFLOW_YES and overflow != OVERFLOW_NO:
return ChangeSet()
return _set_tank(name, id, 'overflow', 'str', overflow)

View File

@@ -117,7 +117,7 @@ def set_pipe_minor_loss(name: str, id: str, minor_loss: float) -> ChangeSet:
def set_pipe_status(name: str, id: str, status: float) -> ChangeSet:
if status is not PIPE_STATUS_OPEN or status is not PIPE_STATUS_CLOSED or status is not PIPE_STATUS_CV:
if status != PIPE_STATUS_OPEN and status != PIPE_STATUS_CLOSED and status != PIPE_STATUS_CV:
return ChangeSet()
return _set_pipe(name, id, 'status', 'str', str(status))