Onboarding¶
lifx.onboard takes a LIFX device that is not on your network, joins its own
setup access point (SoftAP), hands it your home network's credentials, and
confirms it arrived. Import it explicitly: nothing here is exported from the
top-level lifx namespace. The onboarding guide
explains the sequence and how the pieces fit together; this page is the
reference.
lifx-async ships no implementation of Scanner or Joiner. Joining a host to
a WiFi network needs subprocesses, ctypes or an app bundle, so those live
outside this library.
Entry points¶
onboard
async
¶
onboard(
network: HomeNetwork,
*,
scanner: Scanner | None,
joiner: Joiner,
target: str | Serial | None = None,
softap: SoftApClient | None = None,
verify: DeviceWatcher | bool = True,
on_event: EventCallback | None = None,
events: OnboardEventQueue | None = None,
rejoin_ssid: str | None = None,
rejoin_password: str = "",
min_rssi: float = 0.0,
include_non_lifx: bool = False,
legacy_tls: bool = False,
softap_address: str = SOFTAP_ADDRESS,
softap_port: int = SOFTAP_PORT,
find_timeout: float = FIND_TIMEOUT,
find_poll: float = FIND_POLL,
wait_timeout: float = WAIT_TIMEOUT,
wait_poll: float = WAIT_POLL,
dial_timeout: float = DIAL_TIMEOUT,
rejoin_timeout: float = REJOIN_TIMEOUT,
rejoin_poll: float = REJOIN_POLL,
auto_join_wait: float = AUTO_JOIN_WAIT,
verify_timeout: float = VERIFY_TIMEOUT,
verify_poll: float = VERIFY_POLL,
) -> Result
Onboard one device from its SoftAP onto network.
The sequence is scan, join, wait, dial, configure, rejoin and verify.
Progress is reported through on_event (called synchronously) and
events (a bounded queue that never blocks the sequence).
| PARAMETER | DESCRIPTION |
|---|---|
network
|
The home network to hand the device.
TYPE:
|
scanner
|
Lists visible networks; may be
TYPE:
|
joiner
|
Joins the host to networks. Its optional capabilities
(
TYPE:
|
target
|
A SoftAP name such as |
softap
|
The control channel; a
TYPE:
|
verify
|
A running
TYPE:
|
on_event
|
Called with each
TYPE:
|
events
|
A queue every event is put on.
TYPE:
|
rejoin_ssid
|
A network to return the host to in preference to the
one it was on;
TYPE:
|
rejoin_password
|
The password for
TYPE:
|
min_rssi
|
Passed to the scanner.
TYPE:
|
include_non_lifx
|
Passed to the scanner.
TYPE:
|
legacy_tls
|
Pin TLS 1.0 for pre-2020 firmware.
TYPE:
|
softap_address
|
Where the device's SoftAP listens.
TYPE:
|
softap_port
|
The port it listens on.
TYPE:
|
find_timeout
|
Budget for the scan, and separately for the join.
TYPE:
|
find_poll
|
Interval between scan attempts and between join attempts. |
wait_timeout
|
Budget for the SoftAP to accept a probe.
TYPE:
|
wait_poll
|
Interval between probes; each probe is bounded by it. |
dial_timeout
|
Budget for the TLS dial.
TYPE:
|
rejoin_timeout
|
Budget per rejoin target.
TYPE:
|
rejoin_poll
|
Interval between rejoin attempts and host network polls.
TYPE:
|
auto_join_wait
|
How long the OS auto-join gets once the host has left the SoftAP.
TYPE:
|
verify_timeout
|
Budget for the device to appear on the LAN.
TYPE:
|
verify_poll
|
Discovery sweep interval while verifying.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Result
|
The |
| RAISES | DESCRIPTION |
|---|---|
InvalidSoftApTargetError
|
If |
ValueError
|
If |
LifxOnboardError
|
The typed error of the phase that failed; its
|
CancelledError
|
After host recovery, when cancelled. |
Source code in src/lifx/onboard/machine.py
872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 | |
bulk_onboard
async
¶
bulk_onboard(
network: HomeNetwork,
*,
scanner: Scanner,
joiner: Joiner,
targets: Iterable[Serial | str] = (),
max_devices: int | None = None,
scan_interval: float = SCAN_INTERVAL,
stop_when_idle_for: float | None = None,
softap: SoftApClient | None = None,
verify: DeviceWatcher | bool = True,
on_event: EventCallback | None = None,
events: OnboardEventQueue | None = None,
rejoin_ssid: str | None = None,
rejoin_password: str = "",
min_rssi: float = 0.0,
include_non_lifx: bool = False,
legacy_tls: bool = False,
softap_address: str = SOFTAP_ADDRESS,
softap_port: int = SOFTAP_PORT,
find_timeout: float = FIND_TIMEOUT,
find_poll: float = FIND_POLL,
wait_timeout: float = WAIT_TIMEOUT,
wait_poll: float = WAIT_POLL,
dial_timeout: float = DIAL_TIMEOUT,
rejoin_timeout: float = REJOIN_TIMEOUT,
rejoin_poll: float = REJOIN_POLL,
auto_join_wait: float = AUTO_JOIN_WAIT,
verify_timeout: float = VERIFY_TIMEOUT,
verify_poll: float = VERIFY_POLL,
) -> AsyncIterator[Result]
Onboard every new LIFX SoftAP the scanner sees, one device at a time.
Scans every scan_interval seconds. Each round that shows a LIFX SoftAP
not yet attempted (and, when targets is given, on the allow-list)
runs join, wait, dial, configure and rejoin for it exactly as
onboard() does, with host recovery on failure, then scans again. A
serial is attempted once however often it recurs. A failed attempt yields
a Result with phase and error set; the loop goes on.
Verification is interleaved. With verify set, one watcher serves the
whole run: a caller's DeviceWatcher is used as is and left running,
while True opens a library-owned watcher (sweep_interval of
verify_poll, UDP only) before the first attempt and closes it when
the run ends, also on cancellation. As soon as a device is configured it
starts listening for that serial on the LAN, and once the host has
rejoined its network the wait of up to verify_timeout runs in the
background while the loop scans for the next device. Results are
therefore yielded in completion order: a device verified while a later
one was being configured is yielded as soon as the generator is resumed,
and every pending verification is drained after the loop ends. With
verify=False each Result is yielded right after its rejoin.
The loop ends when every allow-listed target has been attempted, when
max_devices attempts (successful or not) have been made, when
stop_when_idle_for seconds of scanning have passed without a new
serial (the clock restarts when a device is attempted and again when
scanning resumes after it, so time spent onboarding never counts as
idle, while a scan that shows nothing new does not reset it), or when
the consumer's task is cancelled,
in which case host recovery runs for the device in flight, pending
verifications are cancelled, the owned watcher is closed and the
CancelledError propagates. Allow-listed targets never seen are
yielded last as SCAN-phase SoftApNotFoundError results. Without
targets, max_devices or stop_when_idle_for the loop runs
until cancelled.
Events reach on_event and events as they do from onboard().
SCANNING is emitted when scanning starts and again after each
attempt, not on every round; DISCOVERED once per device attempted,
carrying every network that round's scan returned; the per-device
events are those of onboard().
Early exit: an async for that breaks leaves the generator open
until it is garbage collected; wrap it in contextlib.aclosing() to
close the owned watcher and cancel pending verifications at once.
| PARAMETER | DESCRIPTION |
|---|---|
network
|
The home network to hand every device.
TYPE:
|
scanner
|
Lists visible networks; required, since every device is found by scanning.
TYPE:
|
joiner
|
Joins the host to networks, as for
TYPE:
|
targets
|
Serials or six-hex suffixes to onboard; every other LIFX SoftAP is ignored. Empty means every LIFX SoftAP seen. |
max_devices
|
Stop after this many attempts.
TYPE:
|
scan_interval
|
Seconds between scan rounds that found nothing new.
TYPE:
|
stop_when_idle_for
|
Stop once this many seconds of scanning have passed without a new serial being seen.
TYPE:
|
softap
|
The control channel, reused for every device; a
TYPE:
|
verify
|
A running
TYPE:
|
on_event
|
Called with each
TYPE:
|
events
|
A queue every event is put on.
TYPE:
|
rejoin_ssid
|
As for
TYPE:
|
rejoin_password
|
As for
TYPE:
|
min_rssi
|
Passed to the scanner.
TYPE:
|
include_non_lifx
|
Passed to the scanner.
TYPE:
|
legacy_tls
|
Pin TLS 1.0 for pre-2020 firmware.
TYPE:
|
softap_address
|
Where each device's SoftAP listens.
TYPE:
|
softap_port
|
The port it listens on.
TYPE:
|
find_timeout
|
Budget for each join, and the most one scan may take.
TYPE:
|
find_poll
|
Interval between join attempts. |
wait_timeout
|
Budget for the SoftAP to accept a probe.
TYPE:
|
wait_poll
|
Interval between probes; each probe is bounded by it. |
dial_timeout
|
Budget for the TLS dial.
TYPE:
|
rejoin_timeout
|
Budget per rejoin target.
TYPE:
|
rejoin_poll
|
Interval between rejoin attempts and host network polls.
TYPE:
|
auto_join_wait
|
How long the OS auto-join gets once the host has left the SoftAP.
TYPE:
|
verify_timeout
|
Budget for each device to appear on the LAN.
TYPE:
|
verify_poll
|
Discovery sweep interval of the owned watcher.
TYPE:
|
| YIELDS | DESCRIPTION |
|---|---|
AsyncIterator[Result]
|
One |
AsyncIterator[Result]
|
per allow-listed target never seen. |
| RAISES | DESCRIPTION |
|---|---|
InvalidSoftApTargetError
|
If a target is neither a serial nor a suffix. |
CancelledError
|
After host recovery, when cancelled. |
Source code in src/lifx/onboard/bulk.py
356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 | |
Networks¶
HomeNetwork
dataclass
¶
HomeNetwork(
ssid: str, password: str = "", security: WifiSecurity | int | None = None
)
The network a device should join.
security defaults to OPEN for an empty password and WPA2_AES_PSK
otherwise. The password is never shown by repr or str, but is part
of equality.
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the SSID is empty or over 32 UTF-8 bytes, or the password is over 64 UTF-8 bytes. Nothing is truncated. |
MissingCredentialsError
|
If a secured mode is given with no password. |
SoftApNetwork
dataclass
¶
A WiFi network seen while scanning, usually a LIFX SoftAP.
| ATTRIBUTE | DESCRIPTION |
|---|---|
ssid |
Network name.
TYPE:
|
serial |
Serial derived from the name, or
TYPE:
|
bssid |
Lowercase colon-separated hardware address.
TYPE:
|
rssi |
Signal strength,
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
from_ssid |
Build a network from a LIFX SoftAP name. |
foreign |
Build a network that is not a LIFX SoftAP (no serial). |
Methods:¶
from_ssid
classmethod
¶
from_ssid(ssid: str, rssi: float = 0.0) -> SoftApNetwork
Build a network from a LIFX SoftAP name.
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If |
Source code in src/lifx/onboard/models.py
foreign
classmethod
¶
foreign(ssid: str, bssid: str, rssi: float = 0.0) -> SoftApNetwork
Build a network that is not a LIFX SoftAP (no serial).
Host WiFi protocols¶
The caller supplies a Scanner and a Joiner. The three capabilities after
them are optional and are found at runtime with isinstance; the Joiner is
consulted before the Scanner for each one.
Scanner
¶
Bases: Protocol
Lists the WiFi networks the host can see.
| METHOD | DESCRIPTION |
|---|---|
scan |
Return the networks currently visible. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
interface |
The host interface scanned, for diagnostics.
TYPE:
|
Attributes¶
Methods:¶
scan
async
¶
scan(
*, min_rssi: float = 0.0, include_non_lifx: bool = False
) -> list[SoftApNetwork]
Return the networks currently visible.
Only LIFX SoftAPs are returned unless include_non_lifx is set.
An empty list with no error is a valid result.
Source code in src/lifx/onboard/protocols.py
Joiner
¶
CurrentNetworkReporter
¶
Bases: Protocol
Optional capability: reports the network the host is on.
| METHOD | DESCRIPTION |
|---|---|
current_ssid |
The SSID the host is associated with, or |
NetworkForgetter
¶
Disassociator
¶
Bases: Protocol
Optional capability: drops the host's current association.
| METHOD | DESCRIPTION |
|---|---|
disassociate |
Leave the current network without joining another. |
SoftAP control channel¶
SoftApClient
¶
Bases: Protocol
The control channel the onboarding sequence drives.
SoftApConnection is the real implementation; tests substitute fakes.
| METHOD | DESCRIPTION |
|---|---|
probe |
Make one plain TCP connection to the SoftAP and close it. |
open |
Connect and complete the TLS handshake. |
send_access_point |
Write the credential message for |
close |
Close the connection; safe to call when it is not open. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
address |
The SoftAP address this client talks to.
TYPE:
|
port |
The SoftAP port this client talks to.
TYPE:
|
Attributes¶
Methods:¶
probe
async
¶
probe(*, timeout: float | None = None) -> None
Make one plain TCP connection to the SoftAP and close it.
| RAISES | DESCRIPTION |
|---|---|
SoftApUnreachableError
|
If the connection fails or |
open
async
¶
Connect and complete the TLS handshake.
| RAISES | DESCRIPTION |
|---|---|
SoftApDialError
|
If the connection or handshake fails or the dial timeout elapses first. |
send_access_point
async
¶
send_access_point(target: Serial, network: HomeNetwork) -> None
Write the credential message for target.
| RAISES | DESCRIPTION |
|---|---|
SoftApSendError
|
If the message cannot be written. |
SoftApConnection
¶
SoftApConnection(
address: str = SOFTAP_ADDRESS,
port: int = SOFTAP_PORT,
dial_timeout: float = 10.0,
legacy_tls: bool = False,
)
A TLS connection to a device's SoftAP.
Use as an async context manager, or call open(), send_access_point()
and close() directly. Nothing is ever read from the device.
| PARAMETER | DESCRIPTION |
|---|---|
address
|
The SoftAP address.
TYPE:
|
port
|
The SoftAP port.
TYPE:
|
dial_timeout
|
Seconds allowed for the TCP connect plus TLS handshake.
TYPE:
|
legacy_tls
|
Pin TLS 1.0 with
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
LegacyTlsUnavailableError
|
If |
| METHOD | DESCRIPTION |
|---|---|
probe |
Make one plain TCP connection to the SoftAP and close it. |
open |
Connect to the SoftAP and complete the TLS handshake. |
send_access_point |
Write the credential message for |
close |
Close the connection; a no-op when it is not open. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
address |
The SoftAP address this connection talks to.
TYPE:
|
port |
The SoftAP port this connection talks to.
TYPE:
|
Source code in src/lifx/onboard/softap.py
Attributes¶
Methods:¶
probe
async
¶
probe(*, timeout: float | None = None) -> None
Make one plain TCP connection to the SoftAP and close it.
| PARAMETER | DESCRIPTION |
|---|---|
timeout
|
Seconds to wait for the connection; unbounded when
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
SoftApUnreachableError
|
If the connection fails or |
Source code in src/lifx/onboard/softap.py
open
async
¶
Connect to the SoftAP and complete the TLS handshake.
| RAISES | DESCRIPTION |
|---|---|
SoftApDialError
|
If the connection or handshake fails or
|
Source code in src/lifx/onboard/softap.py
send_access_point
async
¶
send_access_point(target: Serial, network: HomeNetwork) -> None
Write the credential message for target and flush it.
| RAISES | DESCRIPTION |
|---|---|
SoftApSendError
|
If the connection is not open or the write fails. |
Source code in src/lifx/onboard/softap.py
close
async
¶
Close the connection; a no-op when it is not open.
build_access_point_message
¶
build_access_point_message(
target: Serial, network: HomeNetwork, *, source: int | None = None
) -> bytes
Build the 134-byte message that hands a device its home network.
The header is the standard LIFX frame: protocol 1024, addressable set, tagged unset, sequence 0, no acknowledgement or response requested, and the target set to the device's padded serial. The payload is packet 305.
| PARAMETER | DESCRIPTION |
|---|---|
target
|
The serial of the device being onboarded.
TYPE:
|
network
|
The network the device should join.
TYPE:
|
source
|
Frame source; a fresh one is allocated when omitted.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bytes
|
The complete header plus payload, ready to write to the SoftAP. |
Source code in src/lifx/onboard/softap.py
Events¶
OnboardEvent
dataclass
¶
OnboardEvent(
type: OnboardEventType,
phase: OnboardPhase | None,
serial: Serial | None = None,
ssid: str | None = None,
address: str | None = None,
networks: tuple[SoftApNetwork, ...] = (),
timeout: float | None = None,
took: float | None = None,
error: BaseException | None = None,
)
One step of progress through the onboarding sequence.
| ATTRIBUTE | DESCRIPTION |
|---|---|
type |
What happened.
TYPE:
|
phase |
The phase the event belongs to;
TYPE:
|
serial |
The device being onboarded, once known.
TYPE:
|
ssid |
The network the event concerns (a SoftAP or a host network).
TYPE:
|
address |
The SoftAP address, for the wait and dial phases.
TYPE:
|
networks |
Every network the scan returned, for
TYPE:
|
timeout |
The budget a phase started with, for the events that open one.
TYPE:
|
took |
Seconds a step took, for the events that close one.
TYPE:
|
error |
The failure, for
TYPE:
|
OnboardEventQueue
¶
OnboardEventQueue(maxsize: int = 256)
A bounded queue of :class:OnboardEvent that never blocks the producer.
When the queue is full the oldest event is dropped and :attr:dropped
is incremented, the way DeviceWatcher bounds its event iterator.
Iterate with async for; the loop ends once :meth:close has been
called and every queued event has been consumed. The state machine never
closes a queue it was handed, so one queue can serve several runs.
| PARAMETER | DESCRIPTION |
|---|---|
maxsize
|
The most events held at once; at least 1.
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
put |
Queue |
get_nowait |
Pop the oldest queued event, or |
close |
End iteration once the queued events have been consumed. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
dropped |
Events dropped because the queue was full.
TYPE:
|
Source code in src/lifx/onboard/events.py
Attributes¶
Methods:¶
put
¶
put(event: OnboardEvent) -> None
Queue event, dropping the oldest event first when full.
Source code in src/lifx/onboard/events.py
get_nowait
¶
get_nowait() -> OnboardEvent | None
Results¶
Result
dataclass
¶
Result(
serial: Serial | None,
verified: bool,
took: float,
phase: OnboardPhase | None = None,
error: LifxOnboardError | None = None,
host_network: str | None = None,
)
What one onboarding run achieved.
onboard() returns a Result on success and raises on failure; the
raised error carries the same Result as its result attribute.
| ATTRIBUTE | DESCRIPTION |
|---|---|
serial |
The device onboarded, once known.
TYPE:
|
verified |
Whether the device was seen on the LAN afterwards.
TYPE:
|
took |
Seconds the run took.
TYPE:
|
phase |
The phase that failed;
TYPE:
|
error |
The failure;
TYPE:
|
host_network |
The network the host ended on: the SSID a successful
TYPE:
|
Exceptions¶
Every exception derives from LifxOnboardError, which is a LifxError. Each
carries the phase that failed and, once a run has started, the result that
describes it. LifxOnboardError and each subclass below appear with the phase
it normally reports.
LifxError
└── LifxOnboardError
├── MissingCredentialsError (also a ValueError)
├── InvalidSoftApTargetError (no phase)
├── LegacyTlsUnavailableError (no phase)
├── SoftApNotFoundError (SCAN)
├── SoftApJoinError (JOIN)
├── SoftApWaitTimeoutError (WAIT)
├── HostLeftSoftApError (WAIT)
├── SoftApUnreachableError (DIAL)
├── SoftApDialError (DIAL)
├── SoftApSendError (CONFIGURE)
├── HostRejoinError (REJOIN)
└── VerifyTimeoutError (VERIFY)
LifxOnboardError
¶
LifxOnboardError(
message: str,
*,
phase: OnboardPhase | None = None,
result: Result | None = None,
)
Bases: LifxError
Base class for every error raised while onboarding a device.
Messages never contain the home network password.
| ATTRIBUTE | DESCRIPTION |
|---|---|
phase |
The phase that failed, when known.
|
result |
The onboarding result describing the failure, when one exists.
|
Source code in src/lifx/onboard/errors.py
MissingCredentialsError
¶
MissingCredentialsError(
message: str,
*,
phase: OnboardPhase | None = None,
result: Result | None = None,
)
Bases: LifxOnboardError, ValueError
Raised when a secured home network is given without a password.
Source code in src/lifx/onboard/errors.py
InvalidSoftApTargetError
¶
InvalidSoftApTargetError(
message: str,
*,
phase: OnboardPhase | None = None,
result: Result | None = None,
)
Bases: _PhasedOnboardError
Raised when a target is neither a SoftAP name, a serial nor a suffix.
It has no phase: the target is rejected before onboarding starts.
Source code in src/lifx/onboard/errors.py
LegacyTlsUnavailableError
¶
LegacyTlsUnavailableError(
message: str,
*,
phase: OnboardPhase | None = None,
result: Result | None = None,
)
Bases: _PhasedOnboardError
Raised when the host's OpenSSL refuses the TLS 1.0 legacy configuration.
The message includes ssl.OPENSSL_VERSION so the failure is attributed
to the host rather than the device.
Source code in src/lifx/onboard/errors.py
SoftApNotFoundError
¶
SoftApNotFoundError(
message: str,
*,
phase: OnboardPhase | None = None,
result: Result | None = None,
)
Bases: _PhasedOnboardError
Raised when no matching LIFX SoftAP appears within the find timeout.
Source code in src/lifx/onboard/errors.py
SoftApJoinError
¶
SoftApJoinError(
message: str,
*,
phase: OnboardPhase | None = None,
result: Result | None = None,
)
Bases: _PhasedOnboardError
Raised when the host cannot join the SoftAP within the find timeout.
Source code in src/lifx/onboard/errors.py
SoftApWaitTimeoutError
¶
SoftApWaitTimeoutError(
message: str,
*,
phase: OnboardPhase | None = None,
result: Result | None = None,
)
Bases: _PhasedOnboardError
Raised when the SoftAP never accepts a TCP probe within the wait timeout.
Source code in src/lifx/onboard/errors.py
HostLeftSoftApError
¶
HostLeftSoftApError(
message: str,
*,
phase: OnboardPhase | None = None,
result: Result | None = None,
)
Bases: _PhasedOnboardError
Raised when the host is found on another network while waiting.
Source code in src/lifx/onboard/errors.py
SoftApUnreachableError
¶
SoftApUnreachableError(
message: str,
*,
phase: OnboardPhase | None = None,
result: Result | None = None,
)
Bases: _PhasedOnboardError
Raised when a plain TCP probe of the SoftAP address does not connect.
The message names the address and port; it never carries credentials.
Source code in src/lifx/onboard/errors.py
SoftApDialError
¶
SoftApDialError(
message: str,
*,
phase: OnboardPhase | None = None,
result: Result | None = None,
)
Bases: _PhasedOnboardError
Raised when the TCP connect or TLS handshake to the SoftAP fails.
The message names the address and port; it never carries credentials.
Source code in src/lifx/onboard/errors.py
SoftApSendError
¶
SoftApSendError(
message: str,
*,
phase: OnboardPhase | None = None,
result: Result | None = None,
)
Bases: _PhasedOnboardError
Raised when writing the credential message to the SoftAP fails.
The message names the address and port; it never carries credentials.
Source code in src/lifx/onboard/errors.py
HostRejoinError
¶
HostRejoinError(
message: str,
*,
phase: OnboardPhase | None = None,
result: Result | None = None,
)
Bases: _PhasedOnboardError
Raised when the host could not be returned to any rejoin target.
Source code in src/lifx/onboard/errors.py
VerifyTimeoutError
¶
VerifyTimeoutError(
message: str,
*,
phase: OnboardPhase | None = None,
result: Result | None = None,
)
Bases: _PhasedOnboardError
Raised when the device is not seen on the LAN within the verify timeout.
Source code in src/lifx/onboard/errors.py
Timing defaults¶
The defaults were tuned on hardware. Pass a different value to onboard() or
bulk_onboard() only when you have measured a reason to.
Serial helpers¶
parse_serial
¶
Turn a serial, a six-hex suffix or a Serial into a Serial.
Accepts twelve hex characters, or exactly six (the suffix, with the LIFX
OUI prepended). :, - and space separators are ignored and case is
not significant. A Serial is returned unchanged.
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the text is neither form. |
TypeError
|
If text is not a string or |
Source code in src/lifx/onboard/serials.py
Packet 305 types¶
WifiInterface and WifiSecurity are re-exported from lifx.onboard for
convenience; the protocol layer defines them.