Logitech Pop support for emulated_hue component (#12833)

* Update hue_api.py

add dummy group handler for logitech-pop

* Update __init__.py

add HueGroupView for logitech pop

* Update __init__.py

removed whitespace on blankline

* fix line limit and space

* fix indents

* fix more docstring and formatting issues.

* fix more whitespace issues

* Fix pylint issue
pull/14154/head
Marcus 2018-04-29 04:39:21 +10:00 committed by Fabian Affolter
parent ea5c336ab4
commit 8d87b9fed5
2 changed files with 25 additions and 1 deletions

View File

@ -20,7 +20,7 @@ import homeassistant.helpers.config_validation as cv
from homeassistant.util.json import load_json, save_json
from .hue_api import (
HueUsernameView, HueAllLightsStateView, HueOneLightStateView,
HueOneLightChangeView)
HueOneLightChangeView, HueGroupView)
from .upnp import DescriptionXmlView, UPNPResponderThread
DOMAIN = 'emulated_hue'
@ -104,6 +104,7 @@ def setup(hass, yaml_config):
server.register_view(HueAllLightsStateView(config))
server.register_view(HueOneLightStateView(config))
server.register_view(HueOneLightChangeView(config))
server.register_view(HueGroupView(config))
upnp_listener = UPNPResponderThread(
config.host_ip_addr, config.listen_port,

View File

@ -51,6 +51,29 @@ class HueUsernameView(HomeAssistantView):
return self.json([{'success': {'username': '12345678901234567890'}}])
class HueGroupView(HomeAssistantView):
"""Group handler to get Logitech Pop working."""
url = '/api/{username}/groups/0/action'
name = 'emulated_hue:groups:state'
requires_auth = False
def __init__(self, config):
"""Initialize the instance of the view."""
self.config = config
@core.callback
def put(self, request, username):
"""Process a request to make the Logitech Pop working."""
return self.json([{
'error': {
'address': '/groups/0/action/scene',
'type': 7,
'description': 'invalid value, dummy for parameter, scene'
}
}])
class HueAllLightsStateView(HomeAssistantView):
"""Handle requests for getting and setting info about entities."""