-
Notifications
You must be signed in to change notification settings - Fork 0
implemented the refresh function on devices and modifed some class names #1
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
base: develop
Are you sure you want to change the base?
Conversation
| pass | ||
| class CompostDevice(DataDevice): | ||
| def __init__(self): | ||
| self._intervalRefresh=20 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
| class TurbineDevise(TurnOnOfDevise): | ||
| ON = "ON" | ||
| OFF = "OFF" | ||
| on = "ON" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
| from .state_device import StateDevice | ||
|
|
||
|
|
||
| class TankDevice(StateDevice): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
¿Aquí deberías heredar de DataDevise?
| self._data="" | ||
|
|
||
|
|
||
| def refresh(self,currentTime): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aquí debes dejar un espacio, así
def refresh(self, currentTime):|
|
||
|
|
||
| def refresh(self,currentTime): | ||
| self._controller.sendReceiveData("high"+self._activationPin) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aquí dejar espacio así
self._controller.sendReceiveData("high" + self._activationPin)Pero queda mejor así
self._controller.sendReceiveData(f"high{self._activationPin}")| response = self._controller.sendReceiveData(self._analogPin) | ||
| self._controller.sendReceiveData("low"+self._activationPin) | ||
|
|
||
| if len(response.split())!=2: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Espacios!!!
No description provided.