get_dict_key_value
Descripción
Devuelve el valor de una clave en un dict dado.
Versión
- 1.0.0
Ejemplo
import pandoraPluginTools as pt
# Sample device monitoring data
device_data = {
'device_id': '12345',
'temperature': 28.5,
'status': 'online'
}
# Get the temperature reading from the device data
temperature = pt.general.get_dict_key_value(device_data, 'temperature')
if temperature is not None:
print("Temperature:", temperature, "C")
# Get the status of the device
status = pt.general.get_dict_key_value(device_data, 'status')
if status is not None:
print("Status:", status)