Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def update(self):
"""Request an update from the Netatmo API."""
import pyatmo
data = pyatmo.PublicData(self.auth,
LAT_NE=self.lat_ne,
LON_NE=self.lon_ne,
LAT_SW=self.lat_sw,
LON_SW=self.lon_sw,
filtering=True)
if data.CountStationInArea() == 0:
_LOGGER.warning('No Stations available in this area.')
return
self.data = data
def update(self):
"""Request an update from the Netatmo API."""
import pyatmo
raindata = pyatmo.PublicData(self.auth,
LAT_NE=self.lat_ne,
LON_NE=self.lon_ne,
LAT_SW=self.lat_sw,
LON_SW=self.lon_sw,
required_data_type="rain")
if raindata.CountStationInArea() == 0:
_LOGGER.warning('No Rain Station available in this area.')
return
raindata_live = raindata.getLive()
if self.calculation == 'avg':
self.data = sum(raindata_live.values()) / len(raindata_live)
else:
self.data = max(raindata_live.values())
def update(self):
"""Request an update from the Netatmo API."""
data = pyatmo.PublicData(
self.auth,
LAT_NE=self.lat_ne,
LON_NE=self.lon_ne,
LAT_SW=self.lat_sw,
LON_SW=self.lon_sw,
filtering=True,
)
if data.CountStationInArea() == 0:
_LOGGER.warning("No Stations available in this area.")
return
self.data = data