GithubHelp home page GithubHelp logo

mroelandts / pyhomebridge Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 4.0 34 KB

python library to control a Homebridge server

Home Page: https://pypi.org/project/pyhomebridge

License: MIT License

Python 96.31% Shell 3.69%
homebridge pypi-package python3

pyhomebridge's Introduction

mroelandts.github.io

static page

Go to webpage

build and test locally

sudo apt-get install ruby-full build-essential zlib1g-dev
echo '# Install Ruby Gems to ~/gems' >> ~/.bashrc
echo 'export GEM_HOME="$HOME/gems"' >> ~/.bashrc
echo 'export PATH="$HOME/gems/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
gem install jekyll bundler
bundle install
bundle exec jekyll serve

Links

pyhomebridge's People

Contributors

mroelandts avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pyhomebridge's Issues

Great does what i need.. Modified it to go 1 step further :)

Great Python coding, saved me from writing one from scratch (Why re-invent the wheel right??)
anyway this detected my Wiz lights no issues. and allow me to turn them on and off. GREAT!!
I have modified the code slightly to implement brightness control..
AND IT WORKS BRILLIANTLY if i do say so myself.

  • added 9 more variables for Brightness.
  • modified the _get_info_of_accessory function to detect if the accessory has a brightness control if it does then return all the values associated with the brightness (just in case someone wanted to implement checks on the values). if not then return basically what you initially had.
  • modified the print_accessories function to include brightness values if the accessory has brightness.
    as well as changed the accessory print out 'Value' to 'On' which will either be True or False depending on the accessories power state.
  • ADDED function get_brightness to return the current brightness setting of the accessory
  • ADDED function set_brightness to be able to set the brightness of the accessory.

NOTES: Brightness as implemented by myself, and used in the Wiz lights, is a percentile between 1 and 100. so to set the brightness you pass in an integer between 1 and 100.
example: controller = HomeBridgeController(host=hostname, port=port, auth=auth)
controller.set_brightness('', 100)
will set the accessory to 100% brightness.

Let me know what you think!! and if you will implement my modifications :)
Anyway have attached the modified init.py. I have incremented the version to 0.0.4ac (the ac representing my name (Alan Crichton))
init.zip

May be able to expand it further for volume control (for accessories that have volume control as well) I have a LG TV that does, but it is not implemented as an accessory in HomeBridge just as a platform. HomeBridge, and Siri can control the TV but the TV is not exposed as an accessory outside of HomeBridge. I may try implementing the volume setting for accessories if and when i wish to set the TV up as an accessory.

JSONDecodeError

When I start my code I get the following error :

raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I don't know from where it comes since my homebridge starts in insecure mode and it's the good parameters in the function call

controller = HomeBridgeController(host="127.0.0.1", port=8581, auth="543-78-478")

Do you know how to fix this thanks? :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.