예제 #1
0
    def __init__(self, api_key, spot_id, units):
        """Initialize the data object."""
        self._msw = magicseaweed.MSW_Forecast(api_key, spot_id, None, units)
        self.currently = None
        self.hourly = {}

        # Apply throttling to methods using configured interval
        self.update = Throttle(MIN_TIME_BETWEEN_UPDATES)(self._update)
예제 #2
0
    print(uniqueList)
    return (uniqueList)


GPIO.setup(17, GPIO.OUT)
GPIO.setup(18, GPIO.OUT)
GPIO.setup(22, GPIO.OUT)
GPIO.setup(23, GPIO.OUT)
GPIO.setup(9, GPIO.OUT)
GPIO.setup(25, GPIO.OUT)

api_key = "54581012c82ad9250600ea521bf8dd24"
clam_id = 4709
#martinique_id = 371

clam_forecast = magicseaweed.MSW_Forecast(api_key, clam_id)
#clam_now = clam_forecast.get_current()
#print(clam_now.attrs)

clam_future = clam_forecast.get_future()
print(clam_future.summary)

data = pd.DataFrame()

for forecast in clam_future.data:
    forecastTime = time.ctime(forecast.d['localTimestamp'])
    forecastDOW = forecastTime.split(' ', 1)[0]
    print(forecastTime, ':', forecast.d['solidRating'])
    #   print(forecast.get_chart_url('swell'))
    data = data.append(
        pd.DataFrame(