Skip to content

scheduler

ibox.scheduler in the library, ibox scheduler in the CLI.

Scheduled tasks and timer configurations.

complete_schedules

complete_schedules(schedule_type: str = 'WLAN') -> str

Get complete schedules

Parameters:

Name Type Description Default
schedule_type str

type of schedule to retrieve. E.g. "WLAN", "MST". Default is "WLAN"

'WLAN'

device_schedule

device_schedule(mac: str) -> str

Get a device's internet access schedule (parental controls).

In the response, "value" is the current state: "Disable" while internet access is blocked. "override" is a lasting override and "temporaryOverride" whether one lasts until the schedule next changes (see override_device_schedule()). A device without a schedule returns {"status": false}.

Parameters:

Name Type Description Default
mac str

device MAC address.

required

Returns:

Name Type Description
str str

response content

set_device_schedule

set_device_schedule(mac: str, blocked_periods: list, enable: bool = True) -> str

Create or replace a device's internet access schedule (parental controls).

Parameters:

Name Type Description Default
mac str

device MAC address.

required
blocked_periods list

when internet access is blocked, as [{"begin": ..., "end": ...}]. Times are strings like "Mon 22:00" or seconds since Monday 00:00. A period may run past Sunday midnight. [] never blocks; [{"begin": "Mon 00:00", "end": "Sun 24:00"}] blocks all week.

required
enable bool

whether the schedule is active. Default is True.

True
Example

Block Sunday to Thursday nights, 21:00 to 07:00: [{"begin": "Sun 21:00", "end": "Mon 07:00"}, {"begin": "Mon 21:00", "end": "Tue 07:00"}, ...]

Returns:

Name Type Description
str str

response content

enable_device_schedule

enable_device_schedule(mac: str, enable: bool = True) -> str

Turn a device's internet access schedule on or off, keeping its periods.

Parameters:

Name Type Description Default
mac str

device MAC address.

required
enable bool

True to turn the schedule on, False to turn it off. Default is True.

True

Returns:

Name Type Description
str str

response content

override_device_schedule

override_device_schedule(mac: str, access: Literal['allow', 'block', 'schedule'], until_next_change: bool = False) -> str

Allow or block a device's internet access now, whatever its schedule says, e.g. for one more evening.

A lasting override stays until it's set back to "schedule", also when the schedule is turned off and on. set_device_schedule() ends it, and so does devices.block() if it allows access. The web UI doesn't show overrides.

Parameters:

Name Type Description Default
mac str

device MAC address. The device needs a schedule that's on (see set_device_schedule()).

required
access str

"allow" or "block" internet access, or "schedule" to follow the schedule again.

required
until_next_change bool

True to override only until the schedule next switches the other way, e.g. "allow" until the schedule next blocks the device. Default is False: until set back to "schedule".

False

Returns:

Name Type Description
str str

the device's schedule, as from device_schedule(). "value" is "Disable" while it is blocked.

Raises:

Type Description
ValueError

if the device has no schedule, or it's off, or until_next_change is given with "schedule".

remove_device_schedule

remove_device_schedule(mac: str) -> str

Delete a device's internet access schedule.

Parameters:

Name Type Description Default
mac str

device MAC address.

required

Returns:

Name Type Description
str str

response content

wifi_schedule

wifi_schedule() -> str

Get the Wi-Fi schedule, which turns Wi-Fi off at set times to save power (the web UI's power settings).

In the response, "schedule" lists the periods when Wi-Fi is off, "enable" whether the schedule is on, and "value" the current state: "Disable" while Wi-Fi is off. Without a schedule, the response is {"status": false}.

Returns:

Name Type Description
str str

response content

set_wifi_schedule

set_wifi_schedule(off_periods: list, enable: bool = True) -> str

Turn Wi-Fi off at set times every week, like the Wi-Fi schedule in the web UI's power settings.

The schedule covers all Wi-Fi networks, including the guest network. While it's on, wireless devices lose their connection during the off periods, including this computer if it's on Wi-Fi.

Parameters:

Name Type Description Default
off_periods list

when Wi-Fi is off, as [{"begin": ..., "end": ...}], like the blocked periods of set_device_schedule(): times such as "Mon 00:30" or seconds since Monday 00:00. A period may run past Sunday midnight. With [], Wi-Fi stays on, and the schedule is saved turned off, like in the web UI.

required
enable bool

whether the schedule is on. Default is True.

True
Example

Wi-Fi off every night from 01:00 to 06:00: [{"begin": "Mon 01:00", "end": "Mon 06:00"}, {"begin": "Tue 01:00", "end": "Tue 06:00"}, ...]

Returns:

Name Type Description
str str

response content

Raises:

Type Description
ValueError

if Wi-Fi would be off all week. Use wifi.set_enabled(False) to turn it off.

enable_wifi_schedule

enable_wifi_schedule(enable: bool = True) -> str

Turn the Wi-Fi schedule on or off, keeping its periods, like its switch in the web UI's power settings.

While the schedule is on, wireless devices lose their connection during its off periods.

Parameters:

Name Type Description Default
enable bool

True to turn the schedule on, False to turn it off. Default is True.

True

Returns:

Name Type Description
str str

response content

Raises:

Type Description
ValueError

if there's no Wi-Fi schedule. Create one with set_wifi_schedule().

remove_wifi_schedule

remove_wifi_schedule() -> str

Delete the Wi-Fi schedule. Wi-Fi then stays on.

Returns:

Name Type Description
str str

response content