pommi/CGP — pull request #76 by fishilico (2014-05-21 20:35:30+00:00)
Title: plugin: fix typo in temperature type

A "p" is missing in "temperature" in two plugin definitions. This typo has been detected thanks to a PHP warning in ``graph.php`` because ``$plugin_json[$type]['type']`` does not exist when ``$type`` is ``"temerature"``.

After this patch, PHP still warns at the same line of ``graph.php`` about an non-existing item when using the sensors plugin to display temperature graphs because there is no ``'type'`` field. I don't know whether PHP has something like "get an item from an array of null if it doesn't exist" so ``isset($plugin_json[$type]['type'])`` seems to be required somewhere.

Moreover it might be useful to check whether ``$plugin_json[$type]`` exists after loading the plugin (``file_get_contents`` + ``json_decode``) and log an error if not. This would help to detect typos in plugins. What do you think of this idea?