multiple disk usage path ready
This commit is contained in:
@@ -501,7 +501,7 @@ def handle_specific_configurations(data, what_config, device):
|
||||
add_common_attributes(data, "mdi:speedometer", get_translation("cpu_load"), "%", None, "measurement")
|
||||
elif what_config == "cpu_temp":
|
||||
add_common_attributes(data, "hass:thermometer", get_translation("cpu_temperature"), "°C", "temperature", "measurement")
|
||||
elif what_config == "used_space":
|
||||
elif what_config.find("used_space") >=0:
|
||||
add_common_attributes(data, "mdi:harddisk", get_translation("disk_usage"), "%", None, "measurement")
|
||||
elif what_config == "voltage":
|
||||
add_common_attributes(data, "mdi:flash", get_translation("cpu_voltage"), "V", "voltage", "measurement")
|
||||
@@ -584,6 +584,8 @@ def handle_specific_configurations(data, what_config, device):
|
||||
elif what_config == "data_received":
|
||||
add_common_attributes(data, "mdi:download", get_translation("data_received"), "MB", None, "measurement")
|
||||
|
||||
|
||||
# TODO FiX config_json()) to handel used_space_subkey
|
||||
def config_json(what_config, device="0", hass_api=False):
|
||||
data = build_data_template(what_config)
|
||||
handle_specific_configurations(data, what_config, device)
|
||||
@@ -727,8 +729,7 @@ def publish_to_mqtt(monitored_values):
|
||||
for k2,v2 in value.items():
|
||||
k3 = key+'_'+k2
|
||||
client.publish(f"{config.mqtt_discovery_prefix}/sensor/{config.mqtt_topic_prefix}/{hostname}_{k3}/config",
|
||||
config_json(key), qos=config.qos)
|
||||
print('FiX config_JSON!')
|
||||
config_json(k3), qos=config.qos)
|
||||
else:
|
||||
client.publish(f"{config.mqtt_discovery_prefix}/sensor/{config.mqtt_topic_prefix}/{hostname}_{key}/config",
|
||||
config_json(key), qos=config.qos)
|
||||
|
||||
Reference in New Issue
Block a user