Nanoleaf - How do I extract these individual controls into Lovelace entities


Hey guys, I have a nanoleaf and it’s configured as a ‘light’ entity. It comes with all these bells and whistle in the Overview screen that you can change. Problem is they show up as a pop up dialog and not directly on the main screen. I want to extract all these out as individual elements so I can have it visible in my lovelace UI without having them pop out as pop up box. Any idea?
entity: light.nanoleaf
attributes:
 min_mireds: 154 
 max_mireds: 833 
 brightness: 254 
 color_temp: 454 
 hs_color: 30,85 
 rgb_color: 255,146,38 
 xy_color: 0.579,0.388 
 effect_list: Bass Beat drop,Color Burst,Energize,Fireworks,Flames,Forest,Inner Peace,
   Magic Strobe,Meteor Shower,Nemo,Nightclub,Northern Lights,Paint Splatter,Pulse Pop Beats,
   Rave,Retro,Retro Rythm,Rhythmic Northern Lights,Ripple,Romantic,Shooting Stars,
   Snowfall,Sound Bar,Streaking Notes,Ultra Violet Streak,Vibrant Sunrise,White 
 Red effect: Northern Lights 
 friendly_name: 
 nanoleaf icon: mdi:triangle-outline 
 supported_features: 23

Also in my list of services I only have light.toggle, light.turn_off and light.turn_on. Not sure how to go about changing all the other properties/attributes?

Would love to get as far as you have.
I’m getting the error:

File "/usr/src/app/homeassistant/components/light/nanoleaf_aurora.py", line 107, in brightness
    return int(self._brightness * 2.55)
TypeError: unsupported operand type(s) for *: 'dict' and 'float'

Any suggestions where to start with that?

What do you do to get that error? Or are you still configuring the device?

This is just when Hass starts up, and then every few minutes - I get 8000 messages per day.
Adding some debug in the init function I have:

2019-03-12 13:42:41 ERROR (MainThread) [homeassistant.components.light.nanoleaf_aurora] self._brightness is {'value': 100, 'max': 100, 'min': 0}

To be fair, I am using this component against the Canvas device and not the original Aurora, which might make a difference.

I’m sorry I have no clue. I’m fairly new to home assistant myself. Maybe make a separate thread and ask your question with more details and hopefully someone more knowledgeable might be able to help?

I’ve resolved my issue by unwrapping the value from the collection, had to do it a few times in the nanoleaf_aurora.py and __init__.py files, all similar to this:

           if self.supported_features & SUPPORT_COLOR and self.hs_color:
            # pylint: disable=unsubscriptable-object,not-an-iterable
            hs_color = self.hs_color
            _LOGGER.debug('hs_color is %s', hs_color)
            if isinstance(hs_color[0], (float, int)):
              data[ATTR_HS_COLOR] = (
                round(hs_color[0], 3),
                round(hs_color[1], 3),
              )
              data[ATTR_RGB_COLOR] = color_util.color_hs_to_RGB(*hs_color)
              data[ATTR_XY_COLOR] = color_util.color_hs_to_xy(*hs_color)
            else:
              data[ATTR_HS_COLOR] = (
                round(hs_color[0]["value"], 3),
                round(hs_color[1]["value"], 3),
              )
              data[ATTR_RGB_COLOR] = color_util.color_hs_to_RGB(data[ATTR_HS_COLOR][0],data[ATTR_HS_COLOR][1])
              data[ATTR_XY_COLOR] = color_util.color_hs_to_xy(data[ATTR_HS_COLOR][0],data[ATTR_HS_COLOR][1])

In reading the code mode, it has become clear that the file is suited to the Aurora and is very close to supporting the Canvas, which is what I have. So my edits are only a hack until official Canvas component is made available.