<jupyter_start><jupyter_text>First load the URL, in my case I am loading from a json doc on my desktop. This keeps my API key secret.<jupyter_code>hs.__version__
filename = '/Users/robincole/Desktop/Hue_url.json'
URL = hs.load_url(filename)    # base URL of the remote, ending /sensors<jupyter_output><empty_output><jupyter_text>URL = 'http://192.168.0.3/api/my_key/sensors' Fetch the response (raw data) from this URL<jupyter_code>response = hs.get_response_from_url(URL)<jupyter_output><empty_output><jupyter_text>Pretty print the json<jupyter_code>print_json(response)<jupyter_output>{'1': {'config': {'configured': True,
                  'on': True,
                  'sunriseoffset': 30,
                  'sunsetoffset': -30},
       'manufacturername': 'Philips',
       'modelid': 'PHDL00',
       'name': 'Daylight',
       'state': {'daylight': False, 'lastupdated': '2017-10-12T16:45:00'},
       'swversion': '1.0',
       'type': 'Daylight'},
 '10': {'config': {'alert': 'none',
                   'battery': 100,
                   'ledindication': False,
                   'on': True,
                   'pending': [],
                   'reachable': True,
                   'tholddark': 12853,
                   'tholdoffset': 7000,
                   'usertest': False},
        'manufacturername': 'Philips',
        'modelid': 'SML001',
        'name': 'Hue ambient light sensor 2',
        'state': {'dark': True,
                  'daylight': False,
                  'lastupdated': '2017-10-13T05:14:07',
                  'lightlevel': 0},
        'swupdate': [...]<jupyter_text>Lets save the data for convenience.<jupyter_code>hs.save_response(response)
data = hs.parse_hue_api_response(response)
data<jupyter_output><empty_output><jupyter_text>Dev work<jupyter_code>lightlevel = 32949
lux = round(float(10**((lightlevel-1)/10000)),2)
lux<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14873417721518986, 'fraction_numerical': 0.04113924050632911, 'mean_word_length': 2.705078125, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '41573', 'license': 'MIT', 'n_tokens_mistral': 686, 'n_tokens_neox': 611, 'n_words': 124, 'path': 'Hue_sensors demo 13-10-2017.ipynb', 'repo_name': 'robmarkcole/Hue-sensors-usage', 'size': '1896'}