Skip to content

Commit

Permalink
Stop overwriting custom icons when it does a measurement #15
Browse files Browse the repository at this point in the history
  • Loading branch information
MrSuicideParrot committed Apr 21, 2024
1 parent ffe7c1b commit 9c740e2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions speedtest/rootfs/etc/services.d/speedtest/run
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ function post_result() {


if [ "$sensor" = "ping" ]; then
local data="{\"state\":$state, \"attributes\":{\"state_class\":\"measurement\",\"unit_of_measurement\":\"$unitmeasure\",\"icon\":\"mdi:speedometer\",\"server_name\":$servername,\"server_country\":$servercountry,\"server_id\":\"$serverid\"}}"
local data="{\"state\":$state, \"attributes\":{\"state_class\":\"measurement\",\"unit_of_measurement\":\"$unitmeasure\",\"server_name\":$servername,\"server_country\":$servercountry,\"server_id\":\"$serverid\"}}"
elif [ "$sensor" = "download" ]; then
local bytes=${7}
local data="{\"state\":$state, \"attributes\":{\"state_class\":\"measurement\",\"unit_of_measurement\":\"$unitmeasure\",\"icon\":\"mdi:speedometer\",\"server_name\":$servername,\"server_country\":$servercountry,\"server_id\":\"$serverid\",\"bytes_received\":$bytes}}"
local data="{\"state\":$state, \"attributes\":{\"state_class\":\"measurement\",\"unit_of_measurement\":\"$unitmeasure\",\"server_name\":$servername,\"server_country\":$servercountry,\"server_id\":\"$serverid\",\"bytes_received\":$bytes}}"
else
local bytes=${7}
local data="{\"state\":$state, \"attributes\":{\"state_class\":\"measurement\",\"unit_of_measurement\":\"$unitmeasure\",\"icon\":\"mdi:speedometer\",\"server_name\":$servername,\"server_country\":$servercountry,\"server_id\":\"$serverid\",\"bytes_sent\":$bytes}}"
local data="{\"state\":$state, \"attributes\":{\"state_class\":\"measurement\",\"unit_of_measurement\":\"$unitmeasure\",\"server_name\":$servername,\"server_country\":$servercountry,\"server_id\":\"$serverid\",\"bytes_sent\":$bytes}}"
fi

bashio::api.supervisor POST "/core/api/states/sensor.speedtest_$sensor" "$data"
Expand Down

0 comments on commit 9c740e2

Please sign in to comment.