Skip to content

Commit

Permalink
more updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mtlynch committed Mar 25, 2017
1 parent a1fc0e1 commit 351638e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
5 changes: 2 additions & 3 deletions greenpithumb/db_store.py
Expand Up @@ -115,7 +115,8 @@ def open_or_create_db(db_path):
class DbStoreBase(object):
"""Base class for storing information in a database.
This class cannot be shared across threads.
Base class for storing or retrieving information from a database. This class
is not thread-safe.
"""

def __init__(self, db_connection):
Expand All @@ -129,8 +130,6 @@ def __init__(self, db_connection):

def close(self):
self._connection.close()
self._connection = None
self._cursor = None


class SoilMoistureStore(DbStoreBase):
Expand Down
14 changes: 6 additions & 8 deletions greenpithumb/poller.py
Expand Up @@ -83,8 +83,7 @@ def __init__(self, local_clock, poll_interval, temperature_sensor,
poll_interval: An int of how often the sensor should be polled, in
seconds.
temperature_sensor: An interface for reading the temperature.
temperature_store: Queue on which to place temperature records for
storage.
temperature_store: An interface for storing temperature readings.
"""
super(TemperaturePoller, self).__init__(local_clock, poll_interval)
self._temperature_sensor = temperature_sensor
Expand Down Expand Up @@ -112,7 +111,7 @@ def __init__(self, local_clock, poll_interval, humidity_sensor,
poll_interval: An int of how often the sensor should be polled, in
seconds.
humidity_sensor: An interface for reading the humidity.
humidity_store: Queue on which to place humidity records for storage.
humidity_store: An interface for storing humidity readings.
"""
super(HumidityPoller, self).__init__(local_clock, poll_interval)
self._humidity_sensor = humidity_sensor
Expand Down Expand Up @@ -140,7 +139,7 @@ def __init__(self, local_clock, poll_interval, moisture_sensor,
poll_interval: An int of how often the sensor should be polled, in
seconds.
moisture_sensor: An interface for reading the soil moisture level.
moisture_store: Queue on which to place moisture records for storage.
moisture_store: An interface for storing soil moisture readings.
"""
super(MoisturePoller, self).__init__(local_clock, poll_interval)
self._moisture_sensor = moisture_sensor
Expand Down Expand Up @@ -168,8 +167,8 @@ def __init__(self, local_clock, poll_interval, light_sensor,
poll_interval: An int of how often the sensor should be polled, in
seconds.
light_sensor: An interface for reading the ambient light level.
ambient_light_store: Queue on which to place ambient light records for
storage.
ambient_light_store: An interface for storing ambient light
readings.
"""
super(AmbientLightPoller, self).__init__(local_clock, poll_interval)
self._light_sensor = light_sensor
Expand Down Expand Up @@ -202,8 +201,7 @@ def __init__(self, local_clock, poll_interval, pump_manager,
pump_manager: An interface to manage a water pump.
soil_moisture_store: An interface for retrieving soil moisture
readings.
watering_event_store: Queue on which to place watering event records
for storage.
watering_event_store: An interface for storing watering event data.
"""
super(WateringEventPoller, self).__init__(local_clock, poll_interval)
self._pump_manager = pump_manager
Expand Down

0 comments on commit 351638e

Please sign in to comment.