implemented the refresh function on devices and modifed some class names#1
Open
RaynerCadrelo wants to merge 1 commit intodevelopfrom
Open
implemented the refresh function on devices and modifed some class names#1RaynerCadrelo wants to merge 1 commit intodevelopfrom
RaynerCadrelo wants to merge 1 commit intodevelopfrom
Conversation
aprezcuba24
reviewed
May 18, 2020
| pass | ||
| class CompostDevice(DataDevice): | ||
| def __init__(self): | ||
| self._intervalRefresh=20 |
Collaborator
There was a problem hiding this comment.
En python se utiliza para nombre de las variables y métodos "snake_case" por lo que esta variable debe llamarse "_interval_refresh"
El nombre de las clases si es "UpperCamel", así como está está bien
aprezcuba24
reviewed
May 18, 2020
| class TurbineDevise(TurnOnOfDevise): | ||
| ON = "ON" | ||
| OFF = "OFF" | ||
| on = "ON" |
Collaborator
There was a problem hiding this comment.
ON y OFF funcionan como constantes y las constantes se deben nombrar con mayúsculas para que sean fácilmente reconocidas y evitar que sean modificadas sin querer al fonfundirlas con variables.
Esto pasa porque en python no hay constantes
aprezcuba24
reviewed
May 18, 2020
| @@ -2,6 +2,25 @@ | |||
|
|
|||
|
|
|||
| class TankDevice(StateDevice): | |||
Collaborator
There was a problem hiding this comment.
¿Aquí deberías heredar de DataDevise?
aprezcuba24
reviewed
May 18, 2020
| self._data="" | ||
|
|
||
|
|
||
| def refresh(self,currentTime): |
Collaborator
There was a problem hiding this comment.
Aquí debes dejar un espacio, así
def refresh(self, currentTime):
aprezcuba24
reviewed
May 18, 2020
|
|
||
|
|
||
| def refresh(self,currentTime): | ||
| self._controller.sendReceiveData("high"+self._activationPin) |
Collaborator
There was a problem hiding this comment.
Aquí dejar espacio así
self._controller.sendReceiveData("high" + self._activationPin)Pero queda mejor así
self._controller.sendReceiveData(f"high{self._activationPin}")
aprezcuba24
reviewed
May 18, 2020
| response = self._controller.sendReceiveData(self._analogPin) | ||
| self._controller.sendReceiveData("low"+self._activationPin) | ||
|
|
||
| if len(response.split())!=2: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.