Giter VIP home page Giter VIP logo

ha-aurora's People

Contributors

software-2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ha-aurora's Issues

Broken In HA 0.56.2

Appears something changed in the recent HASS versions that broke this.


2017-10-24 10:55:56 ERROR (MainThread) [homeassistant.components.light] Error while setting up platform aurora Traceback (most recent call last): File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 170, in _async_setup_platform SLOW_SETUP_MAX_WAIT, loop=self.hass.loop) File "/usr/lib/python3.4/asyncio/tasks.py", line 372, in wait_for return fut.result() File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result raise self._exception File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run result = self.fn(*self.args, **self.kwargs) File "/home/homeassistant/.homeassistant/custom_components/light/aurora.py", line 38, in setup_platform add_devices([AuroraLight(my_aurora)]) File "/home/homeassistant/.homeassistant/custom_components/light/aurora.py", line 66, in __init__ self._brightness = brightness_scale_nanoleaf_to_hass(light.brightness) File "/home/homeassistant/.homeassistant/custom_components/light/aurora.py", line 46, in brightness_scale_nanoleaf_to_hass return range_value * 2.55 TypeError: unsupported operand type(s) for *: 'NoneType' and 'float'

Support SSDP for discovery

Most users only have a single aurora so using SSDP to discover that device would help limit the amount of configuration required to get this working. Your setup script already has this support, however it does seem to fail to find my aurora.

I put some basic support into the setup_platform call as follows:

from nanoleaf import setup

<SNIP>

vol.Optional(CONF_HOST, default='SSDP'): cv.string,

<SNIP>

def setup_platform(hass, config, add_devices, discovery_info=None):
    host = config.get(CONF_HOST)
    apikey = config.get(CONF_API_KEY)
    name = config.get(CONF_NAME)

    if host == 'SSDP':
        ipAddrList = setup.find_auroras()
        if not ipAddrList:
            _LOGGER.error("Could not locate Nanoleaf Aurora using SSDP, please enter host IP")
            return
        host = ipAddrList[0]

I suspect something is wrong with your SSDP implementation because I am able to get the device IP in about 8 seconds on my network using a different SSDP library (for C# unfortunately). I haven't had a chance to dig into what is going wrong there.

Unable to initialize component

This gets put in the error log when I try setting up the Aurora...

2017-07-04 19:53:36 ERROR (MainThread) [homeassistant.components.light] Error while setting up platform aurora
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 161, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
File "/usr/lib/python3.4/asyncio/tasks.py", line 372, in wait_for
return fut.result()
File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
raise self._exception
File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/homeassistant/.homeassistant/custom_components/light/aurora.py", line 38, in setup_platform
add_devices([AuroraLight(my_aurora)])
File "/home/homeassistant/.homeassistant/custom_components/light/aurora.py", line 70, in init
self._rgb_color = light.rgb
AttributeError: 'Aurora' object has no attribute 'rgb'

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.