sunpeek.db_utils.crud.get_plants#

sunpeek.db_utils.crud.get_plants(session, plant_id=None, plant_name=None, load_sensors=False)#

Gets a plant by name from the database, or all plants if no plant_name or plant_id parameter is supplied :type session: Session :param session: :type plant_id: int :param plant_id: :type plant_name: str :param plant_name:

Returns:

  • common.components.Plant object, if `plant_name` or plant_id param is supplied, otherwise list of all

  • common.components.Plant objects in the DB.