コード例 #1
0
ファイル: calcfuncs01.py プロジェクト: njgreen3/bmon
    def getWUwindSpeed(self, stn, stn2=None):
        """** No parameters are sensor reading arrays **

        Returns a wind speed (mph) from a Weather Underground station.
        'stn' is the primary station to use.  'stn2' is a backup station.
        """
        obs = internetwx.getWUobservation( [stn, stn2] )
        wind_val = float(obs['wind_mph'])
        if wind_val >= 0.0 and wind_val < 150.0:
            return [int(time.time())], [wind_val]
        else:
            return [], []
コード例 #2
0
    def getWUwindSpeed(self, stn, stn2=None):
        """** No parameters are sensor reading arrays **

        Returns a wind speed (mph) from a Weather Underground station.
        'stn' is the primary station to use.  'stn2' is a backup station.
        """
        obs = internetwx.getWUobservation([stn, stn2])
        wind_val = float(obs['wind_mph'])
        if wind_val >= 0.0 and wind_val < 150.0:
            return [int(time.time())], [wind_val]
        else:
            return [], []
コード例 #3
0
ファイル: calcfuncs01.py プロジェクト: njgreen3/bmon
    def getWUtemperature(self, stn, stn2=None):
        """** No parameters are sensor reading arrays **

        Returns a temperature (deg F) from a Weather Underground station.
        'stn' is the primary station to use.  'stn2' is a backup station.
        """
        obs = internetwx.getWUobservation( [stn, stn2] )
        temp_val = float(obs['temp_f'])
        if temp_val>-120.0 and temp_val < 150.0:
            return [int(time.time())], [temp_val]
        else:
            return [], []
コード例 #4
0
    def getWUtemperature(self, stn, stn2=None):
        """** No parameters are sensor reading arrays **

        Returns a temperature (deg F) from a Weather Underground station.
        'stn' is the primary station to use.  'stn2' is a backup station.
        """
        obs = internetwx.getWUobservation([stn, stn2])
        temp_val = float(obs['temp_f'])
        if temp_val > -120.0 and temp_val < 150.0:
            return [int(time.time())], [temp_val]
        else:
            return [], []