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 #21 from foglamp/FOGL-2518
Browse files Browse the repository at this point in the history
FOGL-2518 NOTE added at the end of postinst script; FileNotFoundError handling added  for import
  • Loading branch information
ashish-jabble authored Mar 4, 2019
2 parents 924ed37 + bd25372 commit 88f14a1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
6 changes: 6 additions & 0 deletions packages/Debian/armhf/DEBIAN/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,9 @@ set_files_ownership () {

set_files_ownership
echo "Enviro pHAT plugin is installed."
echo "IMPORTANT NOTE: To use this plugin, it is required to enable i2C on the Pi, please do the following steps:
1) sudo raspi-config
2) Choose advanced options
3) Choose I2C Enable/Disable automatic loading
4) Follow the prompts to set this to load this automatically
5) Reboot the Pi (optional)"
11 changes: 7 additions & 4 deletions python/foglamp/plugins/south/envirophat/envirophat.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,21 @@
# See: http://foglamp.readthedocs.io/
# FOGLAMP_END

""" Module for EnviroHat 'poll' type plugin """
""" Module for Enviro pHAT 'poll' type plugin """

import copy
import uuid
import logging
from envirophat import light, weather, motion # unused: analog

from foglamp.common import logger
from foglamp.plugins.common import utils

_LOGGER = logger.setup(__name__, level=logging.INFO)

try:
from envirophat import light, weather, motion # unused: analog
except FileNotFoundError:
_LOGGER.error("Ensure i2c is enabled on the Pi and other dependencies are installed correctly!")

__author__ = "Ashwin Gopalakrishnan, Amarendra K Sinha"
__copyright__ = "Copyright (c) 2018 Dianomic Systems"
Expand Down Expand Up @@ -92,8 +97,6 @@
},
}

_LOGGER = logger.setup(__name__, level=logging.INFO)


def plugin_info():
""" Returns information about the plugin.
Expand Down

0 comments on commit 88f14a1

Please sign in to comment.