Coverage for janitoo.component : 92%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# -*- coding: utf-8 -*-
An I2C device, ... """
This file is part of Janitoo.
Janitoo is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Janitoo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Janitoo. If not, see <http://www.gnu.org/licenses/>.
"""
"""Initialise the component
:param oid: The oid implemented by the component. :type oid: str """ else:
def uuid(self): """Return an uuid for the component
"""
"""loop
""" pass
"""Check that the component is 'available'
""" return False
"""Start the component. Can be used to start a thread to acquire data.
"""
"""Stop the component.
"""
"""Create a node associated to this component """ name=self.name, product_name=self.product_name, product_type=self.product_type, product_manufacturer=self.product_manufacturer, check_hearbeat_cb=cb_check_hearbeat, oid=self.oid, **kwargs)
#~ def value_poll_get(self, node_uuid, index, prefix=''): #~ """ #~ """ #~ value_id = '%s_%s'%(prefix,'poll') #~ temp_poll = self._bus.nodeman.options.get_option("%s"%node_uuid, value_id) #~ if temp_poll is not None: #~ try: #~ self.node.values[value_id].poll_delay = int(temp_poll) #~ except ValueError: #~ logger.exception('Exception when retrieving poll %s', value_id) #~ #print "%s" % self.node.values #~ return self.node.values[value_id].poll_delay
#~ def value_poll_set(self, node_uuid, index, value, prefix=''): #~ """ #~ """ #~ try: #~ value_id = '%s_%s'%(prefix,'poll') #~ self.node.values[value_id].poll_delay = int(value) #~ self._bus.nodeman.add_poll(self.node.values[value_id]) #~ self._bus.nodeman.options.set_option("%s"%node_uuid, value_id, '%s'%self.node.values[value_id].poll_delay) #~ except ValueError: #~ logger.exception('Exception when setting poll %s', value_id)
'''Retrieve a bus's private value. Take care of exported buses This is the preferred way to retrieve a value of the bus ''' #~ logger.debug('_bus %s'%self._bus) return self._bus.get_bus_value(value_uuid)
"""Needed to publish static files """ return resource_filename(Requirement.parse(self.get_package_name().split('.')[0]), path)
"""Return the name of the package. Needed to publish static files
**MUST** be copy paste in every extension that publish statics files """ return __package__ |