From f2013b461ae0860dadff53b831150fa078347dd2 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Fri, 15 Jan 2021 20:35:57 +0100 Subject: [PATCH] Add disk stats to host endpoint (#49) --- lib/host.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/lib/host.sh b/lib/host.sh index 42e2362..429cdbe 100644 --- a/lib/host.sh +++ b/lib/host.sh @@ -141,3 +141,27 @@ function bashio::host.cpe() { bashio::log.trace "${FUNCNAME[0]}" bashio::host 'host.info.cpe' '.cpe' } + +# ------------------------------------------------------------------------------ +# Returns the available diskspace on the host. +# ------------------------------------------------------------------------------ +function bashio::host.disk_free() { + bashio::log.trace "${FUNCNAME[0]}" + bashio::host 'host.info.disk_free' '.disk_free' +} + +# ------------------------------------------------------------------------------ +# Returns the total diskspace on the host. +# ------------------------------------------------------------------------------ +function bashio::host.disk_total() { + bashio::log.trace "${FUNCNAME[0]}" + bashio::host 'host.info.disk_total' '.disk_total' +} + +# ------------------------------------------------------------------------------ +# Returns the available diskspace on the host. +# ------------------------------------------------------------------------------ +function bashio::host.disk_used() { + bashio::log.trace "${FUNCNAME[0]}" + bashio::host 'host.info.disk_used' '.disk_used' +}