Skip to content

Commit 0f7f58d

Browse files
authored
Update README.md
1 parent 6e3de02 commit 0f7f58d

File tree

1 file changed

+25
-26
lines changed

1 file changed

+25
-26
lines changed

README.md

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -98,50 +98,49 @@ Takes the given storage location `PATH`, gets the data from there and stores it
9898
```python
9999
firebase.put(PATH, DATA, bg=True, id=0)
100100
```
101-
Takes the given storage location `PATH` and uploads the given text `DATA` there.
101+
Takes the given storage location `PATH` and uploads the given value `DATA` there.
102102
- Optional run in the background with the keyword `bg`.
103-
- Set socket id with the keyword `id`. This makes it possible to establish multiple connections to the server instead of just one. Recommended if you know what you are doing, only makes sense if the command is running in the background.
103+
- Set socket id with the keyword `id`. This makes it possible to establish multiple connections to the server instead of just one. Recommended if you know what you are doing, only makes sense if the command is running in the background. (Example at get)
104104
- Example:
105105
```python
106106
firebase.put("testtag1", "1", id=0)
107107
firebase.put("testtag2", "2", id=1) #runs at the same time
108108
```
109109
### patch
110110
```python
111-
firebase.patch(PATH, DATA, bg=True, id=0)
112-
```
113-
Takes the given storage location `PATH` and uploads the given text `DATA` there.
111+
firebase.patch(PATH, DATATAG, bg=True, id=0)
112+
```
113+
Takes the given storage location `PATH` and patches the given key `DATATAG` there, without touching any other tag in the Database.
114+
- Example:
115+
```python
116+
firebase.put("teststruct", {"tag1": "val1", "tag2": "val2"})
117+
firebase.patch("teststruct", {"tag1": "new1"}) #only tag 1 will be changed
118+
```
119+
![image](https://user-images.githubusercontent.com/77546092/114471016-30e98a00-9bf0-11eb-90ec-baec7f10e03c.png)
114120
- Optional run in the background with the keyword `bg`.
115-
- Set socket id with the keyword `id`. This makes it possible to establish multiple connections to the server instead of just one. Recommended if you know what you are doing, only makes sense if the command is running in the background.
116-
- Example:
117-
```python
118-
firebase.patch("testtag1", "1", id=0)
119-
firebase.patch("testtag2", "2", id=1) #runs at the same time
120-
```
121+
- Set socket id with the keyword `id`. This makes it possible to establish multiple connections to the server instead of just one. Recommended if you know what you are doing, only makes sense if the command is running in the background. (Example at get)
121122
### addto
122123
```python
123-
firebase.addto(PATH, DATA, bg=True, id=0)
124-
```
125-
Takes the given storage location `PATH` and uploads the given text `DATA` there.
124+
firebase.addto(PATH, DATA, DUMP=None, bg=True, id=0)
125+
```
126+
Takes the given storage location `PATH` and adds the given value `DATA` there, the randomly generated tag can be optionally stored in the DUMP variable.
127+
- Example:
128+
```python
129+
firebase.addto("testsensor", 128)
130+
firebase.addto("testsensor", 124)
131+
firebase.addto("testsensor", 120, DUMP="tagname")
132+
print(firebase.tagname) #returns {'name': '-MY7GTy4pp2LSpQp5775'}
133+
```
134+
![image](https://user-images.githubusercontent.com/77546092/114472221-1fa17d00-9bf2-11eb-804d-21e0ac425a87.png)
126135
- Optional run in the background with the keyword `bg`.
127-
- Set socket id with the keyword `id`. This makes it possible to establish multiple connections to the server instead of just one. Recommended if you know what you are doing, only makes sense if the command is running in the background.
128-
- Example:
129-
```python
130-
firebase.addto("testtag1", "1", id=0)
131-
firebase.addto("testtag2", "2", id=1) #runs at the same time
132-
```
136+
- Set socket id with the keyword `id`. This makes it possible to establish multiple connections to the server instead of just one. Recommended if you know what you are doing, only makes sense if the command is running in the background. (Example at get)
133137
### delete
134138
```python
135139
firebase.addto(PATH, bg=True, id=0)
136140
```
137141
Takes the given storage location `PATH` deletes the data there.
138142
- Optional run in the background with the keyword `bg`.
139-
- Set socket id with the keyword `id`. This makes it possible to establish multiple connections to the server instead of just one. Recommended if you know what you are doing, only makes sense if the command is running in the background.
140-
- Example:
141-
```python
142-
firebase.delete("testtag1", id=0)
143-
firebase.delete("testtag1", id=0) #runs at the same time
144-
```
143+
- Set socket id with the keyword `id`. This makes it possible to establish multiple connections to the server instead of just one. Recommended if you know what you are doing, only makes sense if the command is running in the background. (Example at get)
145144
## Constants
146145
### FIREBASE_GLOBAL_VAR.GLOBAL_URL
147146
```python

0 commit comments

Comments
 (0)