You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
Lukas S f511ecf193 change to new version (see changelog) 2 years ago
dist change to new version (see changelog) 2 years ago
fhem change to new version (see changelog) 2 years ago
.gitignore first release 2 years ago
CHANGELOG add changelog 2 years ago
README.md add readme.md 2 years ago
setup.py change to new version (see changelog) 2 years ago

README.md

API for Fhem

WebApi

  • HTTP GET-request based lightweight API
  • Supports SSL/TLS
  • Supports Fhem-authentication (basicAuth)
  • Works fast and stable

Descripton

Useful to send commands to Fhem and handle the received answer. A own connection is created for each command which is send to the Fhem-server.

Example

#: import needed API
from fhem import WebApi

#  creates an api class with the WebApi. WebAuth is used so username and password are given.
#  for more security we activate ssl (is on by default). We used a self-sign cert so we disable the verify.
api = WebApi('192.168.1.101', 8083, user='admin', pwd='s3cR3t', ssl=True, verify=False)

#: send the command to toggle "MainBulb01" on. In This case None is returned.
api.send('set MainBulb01 on')

#: saved the received answer from get-command to recv. In this case may a hex color code like 2AFF0F
recv = api.send('get MainBulb01 rgb')

#: print out the received answer
print(recv)

TelApi (removed in 0.1.dev1)

  • Telnet based
  • Supports SSL
  • Supports password auth
  • Removed from code cause of instability and SSL conflicts