pywws.service.temperaturnu¶
Upload current temperature to temperatur.nu.
temperatur.nu is a Swedish web site that shows the current temperature in many places.
Web site: http://www.temperatur.nu/
Additional dependency: http://docs.python-requests.org/
Example
weather.ini
configuration:[temperaturnu] hash = longhexnumber [live] services = ['temperaturnu', 'underground'] [logged] services = ['temperaturnu', 'underground']
You receive the hash value from the temperatur.nu admins during sign
up. It looks like d3b07384d113edec49eaa6238ad5ff00
.
Classes
ToService (context[, check_params]) |
-
class
pywws.service.temperaturnu.
ToService
(context, check_params=True)[source]¶ Bases:
pywws.service.LiveDataService
-
config
= {'hash': ('', True, 'hash')}¶
-
logger
= <Logger pywws.service.temperaturnu (WARNING)>¶
-
service_name
= 'temperaturnu'¶
-
template
= '#live##temp_out "\'t\': \'%.1f\',"#'¶
-
session
()[source]¶ Context manager factory function for a batch of one or more uploads.
This makes it easy to ensure any resources such as an internet connection are properly closed after a batch of uploads. Use the
contextlib.contextmanager()
decorator when you implement this method.For a typical example, see the source code of the
pywws.service.openweathermap
module. If your upload can’t benefit from a session object yieldNone
, as inpywws.service.copy
.
-
Comments or questions? Please subscribe to the pywws mailing list http://groups.google.com/group/pywws and let us know.