Skip to content

Commit 7f757cc

Browse files
updated README
1 parent ce9350f commit 7f757cc

File tree

1 file changed

+34
-37
lines changed

1 file changed

+34
-37
lines changed

README.md

Lines changed: 34 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Web Cam Access via HTTP REST-API
22

33
A Python3 library that unified acess to various web cams with integrated HTTP servers.
4+
The intended use is for connecting cameras with built-in REST servers to the
5+
[home-assistant](https://www.home-assistant.io/) platform.
46

57
## Installation
68
### libhttpcam
@@ -31,97 +33,92 @@ Currently, only `Foscam` and `Wansview` cameras are supported.
3133
- Wansview Q3S (X Series)
3234

3335
## API
34-
#### createCam(brand:str, ip:str, port:int=None) -> (HttpCam, int)
36+
- `createCam(brand:str, ip:str, port:int=None) -> (HttpCam, int)`<br>
3537
creates a HttpCam instance for the supplied `brand`, `ip` address, and `port`.
3638
If `port` is omitted, the camera brand's default port will be used.
3739

3840
returns the camera instance and the port used as a tuple
3941

40-
### Device API
41-
#### Cam(brand, host, port)
42-
Constructor; typically does not get called directly but via the `createCam` function
43-
4442

4543
### Device Properties
46-
#### brand
44+
- `brand()`<br>
4745
returns the camera instance's brand
4846

49-
#### model:
47+
- `model()`<br>
5048
returns the camera instance's model
5149
Note: for `Wansview` cameras this call returns `'unknown'`
5250

53-
#### host
51+
- `host()`<br>
5452
returns the camera instance's ip address
5553

56-
#### port
54+
- `port()`<br>
5755
returns the camera instance's port
5856

59-
6057
### Device Configuration
61-
#### set_credentials(user='', password='')
58+
- `set_credentials(user='', password='')`<br>
6259
sets the credentials used to access the camera.
6360

64-
#### set_sensitivities(motion=0, audio=0)
61+
- `set_sensitivities(motion=0, audio=0)`<br>
62+
6563
Sets the sensitivities for motion detection and audio detection. Both take values between 0 (off) and 100 (sensitive).
6664

67-
#### async_reboot(self) -> Response:
65+
- `async_reboot(self) -> Response`<br>
6866
reboots the camera.
6967

70-
#### async_set_system_time(self) -> Response:
68+
- `async_set_system_time(self) -> Response`<br>
7169
sets the current local time on the camera. This is used for overlays in the snapshots and feeds.
7270

73-
#### async_set_irled(self, status: Status) -> Response:
71+
- `async_set_irled(self, status: Status) -> Response`<br>
7472
sets the status of the active infrared light on the camera. Valid settings are `Status.ON', `Status.OFF`, and `Status.AUTO`
7573

76-
#### async_set_night_mode(self, status: Status) -> Response:
74+
- `async_set_night_mode(self, status: Status) -> Response`<br>
7775
sets the status of the passive infrered sensor. Valid settings are `Status.ON', `Status.OFF`, and `Status.AUTO`
7876

79-
#### async_set_ftp_config(self, server, port, user, passwd) -> Response:
77+
- `async_set_ftp_config(self, server, port, user, passwd) -> Response`<br>
8078
configures the ftp client to allow snapshots and recordings to be stored on a server via FTP.
8179

82-
#### async_set_audio_volumes(self, audio_in=50, audio_out=50) -> Response:
80+
- `async_set_audio_volumes(self, audio_in=50, audio_out=50) -> Response`<br>
8381
configures audio volumes for the camera:
8482
- audio_in: microphone volume
8583
- audio_out: speaker and alert volume
8684

8785
### Device Queries
88-
#### async_get_model(self) -> str:
86+
- `async_get_model(self) -> str`<br>
8987
queries and returns the brand's model number as a string
9088

91-
#### async_get_night_mode(self) -> IRmode:
89+
- `async_get_night_mode(self) -> IRmode`<br>
9290
queries and returns the sensor night mode setting:
93-
- bool result.LED
94-
- bool result.Sensor
91+
- bool result.LED
92+
- bool result.Sensor
9593

96-
#### async_get_alarm_trigger(self) -> Trigger:
94+
- `async_get_alarm_trigger(self) -> Trigger`<br>
9795
queries and returns the alarm trigger setting:
98-
- bool result.motion
99-
- bool result.audio
96+
- bool result.motion
97+
- bool result.audio
10098

101-
#### async_get_alarm_action(self) -> Action:
99+
- `async_get_alarm_action(self) -> Action`<br>
102100
queries and returns the alarm action setting:
103-
- bool result.audio - sound the siren
104-
- bool result.ftp_snap - store snapshots to FTP server
105-
- bool result.ftp_rec - store recordings to FTP server
106-
107-
#### async_get_alarm_triggered(self) -> bool:
108-
queries and returns `True` if an alram was detected.
101+
- bool result.audio - sound the siren
102+
- bool result.ftp_snap - store snapshots to FTP server
103+
- bool result.ftp_rec - store recordings to FTP server
109104

105+
- `async_get_alarm_triggered(self) -> bool`<br>
106+
queries and returns `True` if an alram was detected.<br>
110107
*Currently not implemented, returns `False`*
111108

112-
#### async_get_ftp_config(self):
109+
- `async_get_ftp_config(self)`<br>
113110
queries and returns the current FTP configuration
114111

115112

116113
### Device Actions
117-
#### async_snap_picture(self):
114+
- `async_snap_picture(self)`<br>
118115
snaps a picture and returns the byte array
119116

120-
#### async_mjpeg_stream(self, request):
117+
- `async_mjpeg_stream(self, request)`<br>
121118
requests and returns a motion JPEG stream
122119

123-
#### async_set_alarm(self, trigger: Trigger, action: Action) -> Response:
120+
- `async_set_alarm(self, trigger: Trigger, action: Action) -> Response`<br>
124121
Arms or disarms the camera by7 setting the `trigger` and `action` settings
125122

126-
#### async_ptz_preset(self, preset_pos:int):
123+
- `async_ptz_preset(self, preset_pos:int)`<br>
127124
moves the camera to the specified preprogrammed position if PTX is available

0 commit comments

Comments
 (0)