How to use the aiohue.sensors.Sensors function in aiohue

To help you get started, we’ve selected a few aiohue examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github home-assistant / home-assistant / tests / components / hue / test_sensor_base.py View on Github external
async def mock_request(method, path, **kwargs):
        kwargs["method"] = method
        kwargs["path"] = path
        bridge.mock_requests.append(kwargs)

        if path == "sensors":
            return bridge.mock_sensor_responses.popleft()
        return None

    async def async_request_call(coro):
        await coro

    bridge.async_request_call = async_request_call
    bridge.api.config.apiversion = "9.9.9"
    bridge.api.sensors = Sensors({}, mock_request)
    return bridge