diff --git a/openthread_border_router/config.yaml b/openthread_border_router/config.yaml index ce93af94a..1a2811c9b 100644 --- a/openthread_border_router/config.yaml +++ b/openthread_border_router/config.yaml @@ -39,7 +39,7 @@ ports_description: 8080/tcp: OpenThread Web port 8081/tcp: OpenThread REST API port schema: - device: device(subsystem=tty) + device: device(subsystem=tty)? baudrate: list(57600|115200|230400|460800|921600|1000000) flow_control: bool backbone_interface: str? diff --git a/openthread_border_router/rootfs/etc/s6-overlay/s6-rc.d/otbr-agent/run b/openthread_border_router/rootfs/etc/s6-overlay/s6-rc.d/otbr-agent/run index 36a4c73ad..07b74448d 100755 --- a/openthread_border_router/rootfs/etc/s6-overlay/s6-rc.d/otbr-agent/run +++ b/openthread_border_router/rootfs/etc/s6-overlay/s6-rc.d/otbr-agent/run @@ -42,10 +42,14 @@ if [ "$(cat /proc/sys/net/ipv6/conf/all/forwarding)" != "1" ]; then bashio::log.warning "IPv6 routing/forwarding is not enabled! Make sure the Home Assistant host has IPv6 forwarding enabled." fi -device=$(bashio::config 'device') +if ! bashio::config.has_value 'device' && ! bashio::config.has_value 'network_device'; then + bashio::exit.nok "No device configured. Set either 'device' (serial port) or 'network_device' (TCP host:port)." +fi if bashio::config.has_value 'network_device'; then device="/tmp/ttyOTBR" +else + device="$(bashio::config 'device')" fi baudrate=$(bashio::config 'baudrate')