Clock Mode
set_clock_mode
Set the clock mode of the device. Time is set automatically during connection via Bluetooth.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style
|
int
|
The clock style (0-8). Defaults to 1. |
1
|
date
|
str
|
The date to display (DD/MM/YYYY). Defaults to today. |
''
|
show_date
|
bool
|
Whether to show the date. Defaults to True. |
True
|
format_24
|
bool
|
Whether to use 24-hour format. Defaults to True. |
True
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If any parameter is out of range or invalid. |
Source code in src/pypixelcolor/commands/set_clock_mode.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | |
Examples:
# Enable clock mode with default settings (style 1, 24-hour format, current date)
client.set_clock_mode()
# Set clock style 2 in 12-hour format without displaying date
client.set_clock_mode(style=2, format_24=False, show_date=False)
# Display a specific date (DD/MM/YYYY)
client.set_clock_mode(style=3, date="25/12/2026")
# Enable default clock mode
pypixelcolor -a <MAC_ADDRESS> -c set_clock_mode
# Set clock style 2 in 12-hour format
pypixelcolor -a <MAC_ADDRESS> -c set_clock_mode style=2 format_24=false show_date=false
set_time
Set the device time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hour
|
Optional[int]
|
Hour to set (0-23). If None, uses current hour. |
None
|
minute
|
Optional[int]
|
Minute to set (0-59). If None, uses current minute. |
None
|
second
|
Optional[int]
|
Second to set (0-59). If None, uses current second. |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If any parameter is out of range. |
Note
Command is the same as get_device_info.
Source code in src/pypixelcolor/commands/set_time.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | |
Examples:
# Synchronize device time with current local time
client.set_time()
# Set a specific time (e.g. 14:30:00)
client.set_time(hour=14, minute=30, second=0)
# Sync device time with current local time
pypixelcolor -a <MAC_ADDRESS> -c set_time
# Set a specific time
pypixelcolor -a <MAC_ADDRESS> -c set_time hour=14 minute=30 second=0