Skip to content

Commit

Permalink
Revert "doc"
Browse files Browse the repository at this point in the history
This reverts commit 8a105a0.
  • Loading branch information
apoleon33 committed Feb 12, 2022
1 parent 8a105a0 commit 071b13c
Show file tree
Hide file tree
Showing 23 changed files with 402 additions and 951 deletions.
6 changes: 0 additions & 6 deletions .gitmodules

This file was deleted.

22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
# M-A-P
**An invention to manage a plant automatically**
**an invention to manage a plant automatically**

[![CodeFactor](https://www.codefactor.io/repository/github/apoleon33/m-a-p/badge/main)](https://www.codefactor.io/repository/github/apoleon33/m-a-p/overview/dev)
[![CodeFactor](https://www.codefactor.io/repository/github/apoleon33/m-a-p/badge/main)](https://www.codefactor.io/repository/github/apoleon33/m-a-p/overview/main)

## Installation

### Prerequisites :
You need to have those 3 installed:
### prerequisites :
you need to have those 3 installed:
1. node.js/npm
2. python/pip
3. bash

### Automatic install
### automatic install

```sh
curl -s https://raw.githubusercontent.com/apoleon33/M-A-P/main/install.sh | sh
```

### Manual install
### manual install

```sh
git clone --recursive https://github.com/apoleon33/M-A-P.git && cd M-A-P
git clone https://github.com/apoleon33/M-A-P.git && cd M-A-P
```

Then you will have to install the needed python packages :
then you will have to install the needed python packages :
(once you cd in M-A-P)
```sh
pip install -r requirements.txt
```
Once its done, install the required npm packages:
(in M-A-P/src/front)
then you will have to install the required npm packages:
(once you are in M-A-P/src/front)
```sh
npm install
```

The arduino also require the [
The arduino also require the [
DHT sensor library ](https://github.com/adafruit/DHT-sensor-library) by adafruit to work
1 change: 0 additions & 1 deletion doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
here is the documentation for the M-A-P project

# SUMMARY
- installation guide

## hardware
- components
Expand Down
17 changes: 0 additions & 17 deletions doc/install.md

This file was deleted.

2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#clone the repo
echo "cloning the M-A-P..."
git clone --recursive https://github.com/apoleon33/M-A-P.git
git clone https://github.com/apoleon33/M-A-P.git
cd M-A-P

#install required python packages
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pyserial
pypresence
rich
rich
tkinter
10 changes: 5 additions & 5 deletions src/DiscordIntegration.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from rich import *
from pypresence import Presence


Expand All @@ -12,17 +13,16 @@ def createRpc(self) -> None:
self.RPC = Presence(self.rich_token)
self.RPC.connect()
except:
return False
pass

def update_presence(self, time: int, temperature: int = 0, humidity:int =0) -> None:
def update_presence(self, time: int, temperature: int = 0) -> None:
try:
self.RPC.update(large_image="plant",
large_text="M-A-P",
small_image="simulation",
small_text="using the simulator",
details=f"temperature: {str(temperature)} °C",
state=f"humidity: {str(humidity)} %",
details="temperature: " + str(temperature) + " °C",
start=time,
buttons=[{"label": "github", "url": 'https://github.com/apoleon33/M-A-P'}])
except:
return False
pass
45 changes: 31 additions & 14 deletions src/algorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,42 @@ def decision(self,port:object):
The algorithm that will manage the plant itself.
divided in 2 category,if we are in summer (spring + summer) or in winter (autumn + winter)
'''

time_now = datetime.date.fromtimestamp(time.time())
month = time_now.month # if its winter/summer
if month >= 4 and month <= 9: # summer
# i is the index wether its summer/winter
i = 1
if self.temperature < self.ideal_temperature[1]:
port.write(b'A')


if self.taux1 < 20 and self.ideal_water[1] == "coupelle":
port.write(b'B')


if self.taux1 < 20 and self.ideal_water[1] == "sec":
self.sec_check += 1
if self.sec_check >= 2:
port.write(b'B')
self.sec_check = 0

if self.taux2 < 20 and self.ideal_water[1] == "pot":
port.write(b'C')


else: # winter
i = 0

if self.temperature < self.ideal_temperature[i]:
port.write(b'A')
if self.temperature < self.ideal_temperature[0]:
port.write(b'A')

if self.taux1 < 20 and self.ideal_water[i] == "coupelle":
port.write(b'B')

if self.taux1 < 20 and self.ideal_water[i] == "sec":
self.sec_check += 1
if self.sec_check >= 2:
if self.taux1 < 20 and self.ideal_water[0] == "coupelle":
port.write(b'B')
self.sec_check = 0

if self.taux2 < 20 and self.ideal_water[i] == "pot":
port.write(b'C')

if self.taux1 < 20 and self.ideal_water[0] == "sec":
self.sec_check += 1
if self.sec_check >= 2:
port.write(b'B')
self.sec_check = 0

if self.taux2 < 20 and self.ideal_temperature[0] == "pot":
port.write(b'C')
2 changes: 1 addition & 1 deletion src/editing_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def find_sql(self,date:str) -> list:
return old_data

def opening(self):
self.db = sqlite3.connect(self.location)
self.db = sqlite3.connect(location)
self.cursore = self.db.cursor()

def closing(self):
Expand Down
1 change: 0 additions & 1 deletion src/front/.env

This file was deleted.

4 changes: 1 addition & 3 deletions src/front/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,4 @@ data/temp_0.txt
data/temp_10.txt
data/temp_20.txt
data/temp_30.txt
data/old.db
bot.js
.env
data/old.db
1 change: 0 additions & 1 deletion src/front/data/plant-database
Submodule plant-database deleted from c4ca6d
1 change: 0 additions & 1 deletion src/front/discord-bot
Submodule discord-bot deleted from 3849b2
Loading

0 comments on commit 071b13c

Please sign in to comment.