#NEWLINE# @ classmethod #NEWLINE# def get_available_sensors( cls , types = None ) : #NEWLINE# #INDENT# '\n            Return all available sensors.\n\n            :param list types: the of the sensor to look for. If types is None it will search for all available types.\n\n            :returns: a list of sensor instances.\n            :rtype: list\n\n        ' #NEWLINE# if ( not types ) : #NEWLINE# #INDENT# types = cls . ALL_TYPES #NEWLINE# #UNINDENT# is_sensor = ( lambda s : any ( ( s . startswith ( hex ( x ) [ 2 : ] ) for x in types ) ) ) #NEWLINE# return [ cls ( cls . RESOLVE_TYPE_STR [ s [ : 2 ] ] , s [ 3 : ] ) for s in listdir ( cls . BASE_DIRECTORY ) if is_sensor ( s ) ]