Skip to content
This repository has been archived by the owner on Jan 17, 2020. It is now read-only.

Commit

Permalink
Merge pull request #14 from foglamp/1.5.2RC
Browse files Browse the repository at this point in the history
1.5.2RC
  • Loading branch information
praveen-garg authored Apr 9, 2019
2 parents 6f0f618 + 35823cb commit bdad22c
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 11 deletions.
2 changes: 0 additions & 2 deletions README.md

This file was deleted.

15 changes: 15 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
===================
foglamp-south-pt100
===================

FogLAMP South Plugin for Raspberry PI PT100

Installation
------------

The plugin can be installed with given `requirements.sh <requirements.sh>`_ or the following steps:


.. code-block:: bash
$ sudo apt install -y python3-rpi.gpio
2 changes: 1 addition & 1 deletion VERSION.south.pt100
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
foglamp_south_pt100_version=1.5.0
foglamp_south_pt100_version=1.5.2
foglamp_version>=1.5
2 changes: 1 addition & 1 deletion packages/Debian/armhf/DEBIAN/control
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Version: 0.0
Section: devel
Priority: optional
Architecture: armhf
Depends: foglamp
Depends: foglamp,python3-rpi.gpio
Conflicts:
Maintainer: Dianomic Systems, Inc. <info@dianomic.com>
Homepage: http://www.dianomic.com
Expand Down
12 changes: 5 additions & 7 deletions python/foglamp/plugins/south/pt100/pt100.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
""" Module for PT100 'poll' type plugin """

import copy
import datetime
import json
import uuid
import logging
Expand All @@ -16,7 +15,6 @@
from foglamp.plugins.south.pt100.max31865 import *
from foglamp.common import logger
from foglamp.plugins.common import utils
from foglamp.services.south import exceptions


__author__ = "Ashwin Gopalakrishnan"
Expand Down Expand Up @@ -100,7 +98,7 @@ def plugin_poll(handle):
returns a sensor reading in a JSON document, as a Python dict, if it is available
None - If no reading is available
Raises:
DataRetrievalError
Exception
"""
probes = handle['probes']
data = list()
Expand All @@ -118,10 +116,10 @@ def plugin_poll(handle):
})
except (Exception, RuntimeError) as ex:
_LOGGER.exception("PT100 exception: {}".format(str(ex)))
raise exceptions.DataRetrievalError(ex)

_LOGGER.debug("PT100 reading: {}".format(json.dumps(data)))
return data
raise ex
else:
_LOGGER.debug("PT100 reading: {}".format(json.dumps(data)))
return data


def plugin_reconfigure(handle, new_config):
Expand Down
25 changes: 25 additions & 0 deletions requirements.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

##--------------------------------------------------------------------
## Copyright (c) 2019 Dianomic Systems
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
##--------------------------------------------------------------------

##
## Author: Ashish Jabble
##

set -e

sudo apt install -y python3-rpi.gpio

0 comments on commit bdad22c

Please sign in to comment.