p
This commit is contained in:
parent
66fe83073f
commit
b4baf2236d
@ -1,6 +1,7 @@
|
||||
from Plant import Plant
|
||||
|
||||
class Cucumber(Plant):
|
||||
name = "Cucumber"
|
||||
is_alive = True
|
||||
ttl = 10000
|
||||
hydration = 40
|
||||
|
6
Plant.py
6
Plant.py
@ -40,9 +40,13 @@ class Plant():
|
||||
def ready(self):
|
||||
pass
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
pass
|
||||
|
||||
def get_stats(self):
|
||||
return {"ttl": self.ttl, "is_alive": self.is_alive, "hydration": self.hydration, "soil_level": self.soil_level,
|
||||
"ready": self.ready }
|
||||
"ready": self.ready, "name": self.name }
|
||||
#np. touple'a z info czy żyje, ile ma wody i nawozu
|
||||
|
||||
|
||||
|
1
SZI_PROJEKT_GR1_TRAKTOR
Submodule
1
SZI_PROJEKT_GR1_TRAKTOR
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 6a36cc2dd0d2e35e707e94dc01d522b9566b806c
|
@ -1,6 +1,7 @@
|
||||
from Plant import Plant
|
||||
|
||||
class Tomato(Plant):
|
||||
name = "Tomato"
|
||||
is_alive = True
|
||||
ttl = 12000
|
||||
hydration = 41
|
||||
|
BIN
__pycache__/Cucumber.cpython-37.pyc
Normal file
BIN
__pycache__/Cucumber.cpython-37.pyc
Normal file
Binary file not shown.
BIN
__pycache__/Graph.cpython-37.pyc
Normal file
BIN
__pycache__/Graph.cpython-37.pyc
Normal file
Binary file not shown.
BIN
__pycache__/Plant.cpython-37.pyc
Normal file
BIN
__pycache__/Plant.cpython-37.pyc
Normal file
Binary file not shown.
BIN
__pycache__/Tomato.cpython-37.pyc
Normal file
BIN
__pycache__/Tomato.cpython-37.pyc
Normal file
Binary file not shown.
BIN
__pycache__/Trac.cpython-37.pyc
Normal file
BIN
__pycache__/Trac.cpython-37.pyc
Normal file
Binary file not shown.
BIN
__pycache__/Tree.cpython-37.pyc
Normal file
BIN
__pycache__/Tree.cpython-37.pyc
Normal file
Binary file not shown.
14
tractor.py
14
tractor.py
@ -214,9 +214,17 @@ class Tractor(TreeClass):
|
||||
parsed_data = data.decode().split()
|
||||
time.sleep(self.sleep_time)
|
||||
writer.close()
|
||||
return {"ttl": int(parsed_data[0]), "is_alive": int(parsed_data[1]), "hydration": int(parsed_data[2]), "soil_level": int(parsed_data[3]),
|
||||
"ready": int(parsed_data[4])}
|
||||
|
||||
ttl = int(parsed_data[0])
|
||||
if parsed_data[1]=="True":
|
||||
is_alive = True
|
||||
else:
|
||||
is_alive = False
|
||||
hydration = int(parsed_data[2])
|
||||
soil_level = int(parsed_data[3])
|
||||
ready = int(parsed_data[4])
|
||||
# return {"ttl": int(parsed_data[0]), "is_alive": ((parsed_data[1]=="True")?True:False), "hydration": int(parsed_data[2]), "soil_level": int(parsed_data[3]), "ready": int(parsed_data[4])}
|
||||
return ({"ttl": ttl,"is_alive": is_alive,"hydration": hydration,"soil_level": soil_level,"ready": ready})
|
||||
|
||||
async def service(self):
|
||||
plant_location = await self.look_at_plants(self.current_location)
|
||||
for i in plant_location:
|
||||
|
Loading…
Reference in New Issue
Block a user