Skip to content

Commit b4b917b

Browse files
author
Gedusim
committed
Updated readme
1 parent f213d28 commit b4b917b

File tree

2 files changed

+51
-4
lines changed

2 files changed

+51
-4
lines changed

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
A Python Lighthouse Adapter
66

7-
(README WIP; please consult pyghthouse/ph.py for usage information.)
7+
(README WIP; please consult pyghthouse/ph.py or examples/README.md for usage information.)
88

99
Example scripts can be found [here](examples)
1010

@@ -13,3 +13,17 @@ Example scripts can be found [here](examples)
1313
If you are experiencing errors regarding SSL certificates,
1414
instantiate Pyghthouse using the `ignore_ssl_cert=True`
1515
keyword argument.
16+
17+
## Requiered packages
18+
- websocket-client
19+
- msgpack
20+
21+
##### Optional packages used in examples
22+
- numpy
23+
- Pillow
24+
25+
## Guide to install packages
26+
To install packages in python, you can use `pip install <package name>` in a command line. For example `pip install numpy`.
27+
If you have problems with installing, we recommend to use this guide: https://packaging.python.org/en/latest/tutorials/installing-packages/
28+
29+
In Thonny, you can use a Package Manager. You can find it in `Tools > Manage packages...`

examples/README.md

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,41 @@ This is a loose collection of example scripts for pyghthouse.
44

55
Run any script by entering `python <filename>`.
66

7-
Some scripts have additional dependencies; you can install them by running `pip install -r requirements.txt` from the
8-
repository root directory.
7+
Some scripts have additional dependencies; Check `README.md` in the repository root directory for an installation guide
98

109
If you set up config.py with your username and API token, you won't have to enter them every time you run a script.
11-
Be aware that API tokens are only valid for a few days.
10+
Be aware that API tokens are only valid for a few days.
11+
12+
##### Beware:
13+
Python imports search for the modules in the current folder and in installed packages. So, if you haven't installed
14+
pyghthouse as a package, you need to change the imports of the files in this folder to work.
15+
16+
In the repository root directory should be a file called `example.py`. This file shows the usage of imports of
17+
pyghthouse without having it installed as a package.
18+
Note: To use the imports the same way as `example.py`, your skript has to be in the same folder.
19+
20+
### Available functions
21+
Here you can find a list of functions containing in this package.
22+
23+
`from_html(html_color)`
24+
Converts an HTML color string like FF7F00 or #c0ffee to RGB
25+
26+
`from_hsv(h: float, s: float, v: float)`
27+
Converts HSV (float values between 0 and 1) colors to RGB.
28+
29+
###### The class `Pyghthouse` with
30+
`Pyghthouse(username: str, token: str, ...)`
31+
Set up the `Pyghthouse` object. Needed arguments are `username` and `token`. Optional arguments and further explanation
32+
can be found in the class definition (see `pyghthouse\ph.py`)
33+
34+
`Pyghthouse.empty_image()`
35+
Creates a black image.
36+
This function can also be called with an instance of the `Pyghthouse` object (*`<instance name>.empty_image()`*)
37+
38+
`<instance name>.set_image(image)`
39+
Sends the given `image`.
40+
41+
`<instance name>.close()`
42+
Closes the connection.
43+
44+
*More functions can be found in `pyghthouse\ph.py`*

0 commit comments

Comments
 (0)