# Path: cozify/config.py
# def _initXDG():
# def stateWrite(tmpstate=None):
# def setStatePath(filepath=_initXDG(), copy_current=False):
# def dump_state():
# def _initState(state_file):
# 
# Path: cozify/hub.py
# def devices(*, capabilities=None, and_filter=False, **kwargs):
# def device_reachable(device_id, **kwargs):
# def device_exists(device_id, devs=None, state=None, **kwargs):
# def device_eligible(device_id, capability_filter, devs=None, state=None, **kwargs):
# def device_toggle(device_id, **kwargs):
# def device_state_replace(device_id, state, **kwargs):
# def device_on(device_id, **kwargs):
# def device_off(device_id, **kwargs):
# def light_temperature(device_id, temperature=2700, transition=0, **kwargs):
# def light_color(device_id, hue, saturation=1.0, transition=0, **kwargs):
# def light_brightness(device_id, brightness, transition=0, **kwargs):
# def remote(hub_id, new_state=None):
# def autoremote(hub_id, new_state=None):
# def tz(**kwargs):
# def ping(autorefresh=True, **kwargs):
# def name(hub_id):
# def host(hub_id):
# def token(hub_id, new_token=None):
# def hub_id(hub_name):
# def exists(hub_id):
# def default():
# def _getAttr(hub_id, attr, default=None, boolean=False):
# def _setAttr(hub_id, attr, value, commit=True):
# def _get_id(**kwargs):
# def _fill_kwargs(kwargs):
# def _clean_state(state):
# def _in_range(value, low, high, description='undefined'):
# def getDevices(**kwargs):  # pragma: no cover
# def getDefaultHub():  # pragma: no cover
# def getHubId(hub_name):  # pragma: no cover


import os, pytest, tempfile, datetime
import hashlib, json
from absl import logging
from mbtest.server import MountebankServer
from cozify import config, hub
from . import fixtures_devices as dev
    from cozify import cloud
    from cozify import cloud
    from cozify import hub
#!/usr/bin/env python3






@pytest.fixture(scope="module")
def vcr_config():
    return {"filter_headers": ["authorization", "X-Hub-Key"], "record_mode": "rewrite"}


@pytest.fixture
def tmp_cloud():
    obj = lambda: 0
    obj.configfile, obj.configpath = tempfile.mkstemp(suffix='tmp_cloud')
    obj.section = 'Cloud'
    obj.email = 'example@example.com'
    obj.token = 'eyJkb20iOiJ1ayIsImFsZyI6IkhTNTEyIiwidHlwIjoiSldUIn0.eyJyb2xlIjo4LCJpYXQiOjE1MTI5ODg5NjksImV4cCI6MTUxNTQwODc2OSwidXNlcl9pZCI6ImRlYWRiZWVmLWFhYWEtYmJiYi1jY2NjLWRkZGRkZGRkZGRkZCIsImtpZCI6ImRlYWRiZWVmLWRkZGQtY2NjYy1iYmJiLWFhYWFhYWFhYWFhYSIsImlzcyI6IkNsb3VkIn0.QVKKYyfTJPks_BXeKs23uvslkcGGQnBTKodA-UGjgHg'  # valid but useless jwt token.
    obj.expiry = datetime.timedelta(days=1)
    obj.now = datetime.datetime.now()
    obj.iso_now = obj.now.isoformat().split(".")[0]
    obj.yesterday = obj.now - datetime.timedelta(days=1)
    obj.iso_yesterday = obj.yesterday.isoformat().split(".")[0]

# Path: cozify/config.py
# def _initXDG():
# def stateWrite(tmpstate=None):
# def setStatePath(filepath=_initXDG(), copy_current=False):
# def dump_state():
# def _initState(state_file):
# 
# Path: cozify/hub.py
# def devices(*, capabilities=None, and_filter=False, **kwargs):
# def device_reachable(device_id, **kwargs):
# def device_exists(device_id, devs=None, state=None, **kwargs):
# def device_eligible(device_id, capability_filter, devs=None, state=None, **kwargs):
# def device_toggle(device_id, **kwargs):
# def device_state_replace(device_id, state, **kwargs):
# def device_on(device_id, **kwargs):
# def device_off(device_id, **kwargs):
# def light_temperature(device_id, temperature=2700, transition=0, **kwargs):
# def light_color(device_id, hue, saturation=1.0, transition=0, **kwargs):
# def light_brightness(device_id, brightness, transition=0, **kwargs):
# def remote(hub_id, new_state=None):
# def autoremote(hub_id, new_state=None):
# def tz(**kwargs):
# def ping(autorefresh=True, **kwargs):
# def name(hub_id):
# def host(hub_id):
# def token(hub_id, new_token=None):
# def hub_id(hub_name):
# def exists(hub_id):
# def default():
# def _getAttr(hub_id, attr, default=None, boolean=False):
# def _setAttr(hub_id, attr, value, commit=True):
# def _get_id(**kwargs):
# def _fill_kwargs(kwargs):
# def _clean_state(state):
# def _in_range(value, low, high, description='undefined'):
# def getDevices(**kwargs):  # pragma: no cover
# def getDefaultHub():  # pragma: no cover
# def getHubId(hub_name):  # pragma: no cover


# Path: cozify/test/fixtures.py
import os, pytest, tempfile, datetime
import hashlib, json
from absl import logging
from mbtest.server import MountebankServer
from cozify import config, hub
from . import fixtures_devices as dev
    from cozify import cloud
    from cozify import cloud
    from cozify import hub

#!/usr/bin/env python3






@pytest.fixture(scope="module")
def vcr_config():
    return {"filter_headers": ["authorization", "X-Hub-Key"], "record_mode": "rewrite"}


@pytest.fixture
def tmp_cloud():
    obj = lambda: 0
    obj.configfile, obj.configpath = tempfile.mkstemp(suffix='tmp_cloud')
    obj.section = 'Cloud'
    obj.email = 'example@example.com'
    obj.token = 'eyJkb20iOiJ1ayIsImFsZyI6IkhTNTEyIiwidHlwIjoiSldUIn0.eyJyb2xlIjo4LCJpYXQiOjE1MTI5ODg5NjksImV4cCI6MTUxNTQwODc2OSwidXNlcl9pZCI6ImRlYWRiZWVmLWFhYWEtYmJiYi1jY2NjLWRkZGRkZGRkZGRkZCIsImtpZCI6ImRlYWRiZWVmLWRkZGQtY2NjYy1iYmJiLWFhYWFhYWFhYWFhYSIsImlzcyI6IkNsb3VkIn0.QVKKYyfTJPks_BXeKs23uvslkcGGQnBTKodA-UGjgHg'  # valid but useless jwt token.
    obj.expiry = datetime.timedelta(days=1)
    obj.now = datetime.datetime.now()
    obj.iso_now = obj.now.isoformat().split(".")[0]
    obj.yesterday = obj.now - datetime.timedelta(days=1)
    obj.iso_yesterday = obj.yesterday.isoformat().split(".")[0]

    config.setStatePath(obj.configpath)