项目作者: Breuxi

项目描述 :
Python Wrapper Libary for HomeMatic
高级语言: Python
项目地址: git://github.com/Breuxi/HomematicPy.git
创建时间: 2016-06-11T14:03:02Z
项目社区:https://github.com/Breuxi/HomematicPy

开源协议:MIT License

下载


HomematicPython

Easy Python Libary for HomeMatic Systems

Installing

  1. pip install git+https://github.com/Breuxi/HomematicPy.git

Examples (examples/example.py)

Login

  1. session_id = Homematic.login(homematic_ip, "API", "api")
  2. print(session_id)

Get Devices

  1. devices = Homematic.getDevices(homematic_ip, session_id, "BidCos-RF")
  2. print(json.dumps(devices, sort_keys=True, indent=4))

Set Value

  1. value_set = Homematic.setValue(homematic_ip, session_id, "BidCos-RF", "NEQ0153210:1", "STATE", "boolean", "0")
  2. if value_set:
  3. print("Value STATE was set to 0")
  4. else:
  5. print("Cant set Value STATE to 0")

List Methods

  1. print(Homematic.listMethods(homematic_ip))
  2. print(Homematic.getValue(homematic_ip, session_id, "BidCos-RF", "NEQ0153210:1", "STATE"))

Log out

  1. logout = Homematic.logout(homematic_ip, session_id)
  2. if logout:
  3. print("Successfully logged out!")
  4. else:
  5. print("Log out failed")