> For the complete documentation index, see [llms.txt](https://sryvkver.gitbook.io/cobi.bike/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sryvkver.gitbook.io/cobi.bike/namespaces/battery-controller/slots.md).

# Slots

Provides information about the amount of slots present in the eBike and how many are used.

{% tabs %}
{% tab title="Typescript" %}

```typescript
const onBatterySlotsChange = (value: BatterySlots, timestamp?: Date) => {
    console.log(value, timestamp);
};

COBI.batteryController.slots.read(onBatterySlotsChange); // Instantly get the current value
COBI.batteryController.slots.subscribe(onBatterySlotsChange);
COBI.batteryController.slots.unsubscribe(onBatterySlotsChange);
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
const onBatterySlotsChange = (value, timestamp) => {
    console.log(value, timestamp);
};

COBI.batteryController.slots.read(onBatterySlotsChange); // Instantly get the current value
COBI.batteryController.slots.subscribe(onBatterySlotsChange);
COBI.batteryController.slots.unsubscribe(onBatterySlotsChange);
```

{% endtab %}
{% endtabs %}

{% content-ref url="/pages/tKKsAr2wWsj2lBWXbVdE" %}
[BatterySlots](/cobi.bike/entities/batteryslots.md)
{% endcontent-ref %}

<details>

<summary>Example Response</summary>

```json
{
    "count": 1,
    "used": 1
}
```

</details>
