<commit_before>Our LightMeter widget can use the light level reading to dynamically decide how long to leave the camera shutter open for. But since it's a web app, we can get it to do much more.

Let's learn how to set exposure readings for different daylight conditions.

__Extend your answer to the last problem to set 2 lighting condition readings.__

Using your solution to the previous problem, you can use the `addLightingCondition()` method to add lighting conditions. These allow you to map a light sensor reading to an exposure time.

It takes an object of the following format:

```js
{
  name: 'Direct sun', // the human readable name of the condition
  exposure: {         // a map of film types (ISO) to times in seconds
    400: 1.3,         // 400 ISO film needs 1.3s exposure time in direct sun
    800: 1.6
  },
  colour: {           // some fun colours for the UI (optional)
    start: '#f7ec86',
    stop : '#fdc753'
  },
  sensorRange: [0, 0.5] // min, max
                        // this lighting is selected when the sensor
                        // value is between 0 and just under 0.5
}
```

Add 2 lighting conditions:

    name: Direct sun
    ISO: 400, 1.3 seconds
    minimum light sensor: 0.6
    maximum light sensor: 1

    name: Indoors
    ISO: 400, 180 seconds
    minimum light sensor: 0
    maximum light sensor: 0.6

## Hints

You can pass an array of objects to `addLightingCondition()`.

The widget includes an array of default conditions, try `console.log(LightMeterWidget.defaults)`.

Don't forget, you can run your program in the browser using `ID=<your-id> lightmeter --port 11686 program.js` and loading the URL in your browser.
<commit_msg>Minor re-jig/update to how_long_to_expose_film problem.md<commit_after>Our camera is smart because it uses light readings to tell us how long to leave the camera shutter open for.

That is the difference between a good and bad picture!

Lets configure our `LightMeter UI` for different daylight conditions. We'll include the optimal film exposure for each condition.

The `LightMeter UI` will change displayed exposure time when light conditions change.

__Write a program that visualizes light conditions and optimal exposure time.__

Based on your previous solution, Configure `LightMeterWidget` using the `addLightingCondition()` method.

These allow you to map a light sensor reading to an exposure time.

It takes an object of the following format:

```js
{
  name: 'Direct sun', // the human readable name of the condition
  exposure: {         // a map of film types (ISO) to times in seconds
    400: 1.3,         // 400 ISO film needs 1.3s exposure time in direct sun
    800: 1.6
  },
  colour: {           // some fun colours for the UI (optional)
    start: '#f7ec86',
    stop : '#fdc753'
  },
  sensorRange: [0, 0.5] // min, max
                        // this lighting is selected when the sensor
                        // value is between 0 and just under 0.5
}
```

Add 2 lighting conditions:

    name: Direct sun
    ISO: 400, 1.3 seconds
    minimum light sensor: 0.6
    maximum light sensor: 1

    name: Indoors
    ISO: 400, 180 seconds
    minimum light sensor: 0
    maximum light sensor: 0.6

## Hints

You can pass an array of objects to `addLightingCondition()`.

The widget includes an array of default conditions, try `console.log(LightMeterWidget.defaults)`.

Don't forget, you can run your program in the browser using `ID=<your-id> lightmeter --port 11686 program.js` and loading the URL in your browser.

{'fraction_non_alphanumeric': 0.07005104934770277, 'fraction_numerical': 0.02864435621100397, 'mean_word_length': 2.9232480533926584, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6335416', 'n_tokens_mistral': 1046, 'n_tokens_neox': 939, 'n_words': 493}