Skip to content

Commit

Permalink
refactor(plugin): improve code structure and performance
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre-io committed Oct 1, 2024
1 parent f60fa54 commit 701c46b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion vcontrold/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- https://developers.home-assistant.io/docs/add-ons/presentation#keeping-a-changelog -->

## 1.12.0, 1.12.1, 1.12.2, 1.12.3, 1.12.4
## 1.12.0-5

- Code Optimization

Expand Down
4 changes: 2 additions & 2 deletions vcontrold/rootfs/etc/services.d/get_vcontrold_settings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ export REFRESH_RATE=$(bashio::config 'refresh')
if bashio::config.has_value 'vcontrol_host'; then
export VCONTROL_HOST=$(bashio::config 'vcontrol_host')
else
bashio::log.warning "vcontrol_host not set in configuration. Defaulting to 'localhost'."
bashio::log.info "vcontrol_host not set in configuration. Defaulting to 'localhost'."
export VCONTROL_HOST="localhost"
fi

# Fetch VCONTROL_PORT and set to 3002 by default if not provided
if bashio::config.has_value 'vcontrol_port'; then
export VCONTROL_PORT=$(bashio::config 'vcontrol_port')
else
bashio::log.warning "vcontrol_port not set in configuration. Defaulting to '3002'."
bashio::log.info "vcontrol_port not set in configuration. Defaulting to '3002'."
export VCONTROL_PORT="3002"
fi

Expand Down
3 changes: 3 additions & 0 deletions vcontrold/rootfs/etc/services.d/vclient_pub/run
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ if [[ -z "$REFRESH_RATE" || -z "$VCONTROL_HOST" || -z "$VCONTROL_PORT" ]]; then
exit 1
fi

# Pause execution for 5 seconds to ensure all services are fully initialized
sleep 5

# Run your program
while true; do
bashio::log.info "Executing vclient_pub command..."
Expand Down

0 comments on commit 701c46b

Please sign in to comment.