26 lines
811 B
Bash
26 lines
811 B
Bash
#!/usr/bin/with-contenv bashio
|
|
|
|
# Read configuration options
|
|
readonly TUYA_EMAIL=$(bashio::config 'TUYA_EMAIL')
|
|
readonly TUYA_PASSWORD=$(bashio::config 'TUYA_PASSWORD')
|
|
readonly TUYA_REGION=$(bashio::config 'TUYA_REGION')
|
|
|
|
# Check if required options are set
|
|
if [[ -z "${TUYA_EMAIL}" ]]; then
|
|
bashio::log.fatal "Please configure your Tuya email in the addon options."
|
|
exit 1
|
|
fi
|
|
|
|
if [[ -z "${TUYA_PASSWORD}" ]]; then
|
|
bashio::log.fatal "Please configure your Tuya password in the addon options."
|
|
exit 1
|
|
fi
|
|
|
|
# Authenticate with Tuya
|
|
bashio::log.info "Authenticating with Tuya using email/password..."
|
|
printf "%s\n%s\n%s\n" "${TUYA_REGION}" "${TUYA_EMAIL}" "${TUYA_PASSWORD}" | /tuya_auth_login.exp
|
|
|
|
# Rest bleibt gleich...
|
|
tuya-ipc-terminal cameras refresh
|
|
tuya-ipc-terminal rtsp start --port 8554
|