diff --git a/modules/dresdenwetter/__init__.py b/modules/dresdenwetter/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..2d2e511da9a8ea9d94cd8c3a463f8d18c42a9901
--- /dev/null
+++ b/modules/dresdenwetter/__init__.py
@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+
+# Copyright(C) 2010-2013 Romain Bignon, Florent Fourcot
+#
+# This file is part of weboob.
+#
+# weboob is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# weboob is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with weboob. If not, see .
+
+from .backend import DresdenWetterBackend
+
+__all__ = ['DresdenWetterBackend']
diff --git a/modules/dresdenwetter/backend.py b/modules/dresdenwetter/backend.py
new file mode 100644
index 0000000000000000000000000000000000000000..ae10a4ff8cb8d59f4a48675bb06f1a0e24d60d4c
--- /dev/null
+++ b/modules/dresdenwetter/backend.py
@@ -0,0 +1,83 @@
+# -*- coding: utf-8 -*-
+
+# Copyright(C) 2010-2013 Romain Bignon, Florent Fourcot
+#
+# This file is part of weboob.
+#
+# weboob is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# weboob is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with weboob. If not, see .
+
+
+from .browser import DresdenWetterBrowser
+from weboob.capabilities.gauge import ICapGauge, GaugeSensor, Gauge,\
+ SensorNotFound
+from weboob.tools.backend import BaseBackend
+
+
+__all__ = ['DresdenWetterBackend']
+
+
+class DresdenWetterBackend(BaseBackend, ICapGauge):
+ NAME = 'dresdenwetter'
+ MAINTAINER = u'Florent Fourcot'
+ EMAIL = 'weboob@flo.fourcot.fr'
+ VERSION = '0.f'
+ LICENSE = 'AGPLv3+'
+ DESCRIPTION = u"Private wetter station Dresden"
+ BROWSER = DresdenWetterBrowser
+
+ def iter_gauges(self, pattern=None):
+ if pattern is None or pattern.lower() in "Dresden"\
+ or pattern.lower() in "Weather":
+ gauge = Gauge("private-dresden")
+ gauge.name = u"Private Wetterstation Dresden"
+ gauge.city = u"Dresden"
+ gauge.object = u"Weather"
+ gauge.sensors = self.browser.get_sensors_list()
+ yield gauge
+
+ def _get_gauge_by_id(self, id):
+ for gauge in self.iter_gauges():
+ if id == gauge.id:
+ return gauge
+ return None
+
+ def _get_sensor_by_id(self, id):
+ for gauge in self.iter_gauges():
+ for sensor in gauge.sensors:
+ if id == sensor.id:
+ return sensor
+ return None
+
+ def iter_sensors(self, gauge, pattern=None):
+ if not isinstance(gauge, Gauge):
+ gauge = self._get_gauge_by_id(gauge)
+ if pattern is None:
+ for sensor in gauge.sensors:
+ yield sensor
+ else:
+ lowpattern = pattern.lower()
+ for sensor in gauge.sensors:
+ if lowpattern in sensor.name.lower():
+ yield sensor
+
+ # Not in the website
+ def iter_gauge_history(self, sensor):
+ raise NotImplementedError()
+
+ def get_last_measure(self, sensor):
+ if not isinstance(sensor, GaugeSensor):
+ sensor = self._get_sensor_by_id(sensor)
+ if sensor is None:
+ raise SensorNotFound()
+ return sensor.lastvalue
diff --git a/modules/dresdenwetter/browser.py b/modules/dresdenwetter/browser.py
new file mode 100644
index 0000000000000000000000000000000000000000..87bd27e74522bc078c7c4deeaced4c0be92ba874
--- /dev/null
+++ b/modules/dresdenwetter/browser.py
@@ -0,0 +1,44 @@
+# -*- coding: utf-8 -*-
+
+# Copyright(C) 2010-2013 Romain Bignon, Florent Fourcot
+#
+# This file is part of weboob.
+#
+# weboob is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# weboob is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with weboob. If not, see .
+
+
+from weboob.tools.browser import BaseBrowser
+from .pages import StartPage
+
+
+__all__ = ['DresdenWetterBrowser']
+
+
+class DresdenWetterBrowser(BaseBrowser):
+ DOMAIN = u'www.dresden-wetter.de'
+ ENCODING = None
+ PAGES = {'.*': StartPage}
+
+ homepage = '/Current_Vantage_Pro.htm'
+
+ def __init__(self, *args, **kwargs):
+ BaseBrowser.__init__(self, *args, **kwargs)
+
+ def home(self):
+ self.location(self.homepage)
+
+ def get_sensors_list(self):
+ if not self.is_on_page(StartPage):
+ self.home()
+ return self.page.get_sensors_list()
diff --git a/modules/dresdenwetter/pages.py b/modules/dresdenwetter/pages.py
new file mode 100644
index 0000000000000000000000000000000000000000..f0bbd3bfe2c89073813d6dfc2e089cbf16ffbb76
--- /dev/null
+++ b/modules/dresdenwetter/pages.py
@@ -0,0 +1,72 @@
+# -*- coding: utf-8 -*-
+
+# Copyright(C) 2010-2012 Romain Bignon, Florent Fourcot
+#
+# This file is part of weboob.
+#
+# weboob is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# weboob is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with weboob. If not, see .
+
+from datetime import datetime, date, time
+from weboob.tools.browser import BasePage
+from weboob.capabilities.gauge import Gauge, GaugeMeasure, GaugeSensor
+from weboob.capabilities.base import NotAvailable, NotLoaded
+
+
+__all__ = ['StartPage']
+
+
+class StartPage(BasePage):
+ name = [u"Temperatur", u"Wind", u"Luftdruck", u"Luftfeuchtigkeit",\
+ u"Niederschlag", u"Globalstrahlung", u"Schneehoehe"]
+ unit = [u"°C", u"km/h", u"hPa", u"%", u"mm", u"W/m²", u"cm"]
+
+
+ def get_sensors_list(self):
+ paraphs = self.document.xpath('//p[@align="center"]')
+ sensors = []
+ for i in range(len(paraphs)):
+ sensor = GaugeSensor("dd-%s" % self.name[i].lower())
+ sensor.name = self.name[i]
+ sensor.unit = self.unit[i]
+ sensor.forecast = NotAvailable
+ sensor.history = NotAvailable
+ sensor.gaugeid = u"private-dresden"
+ paraph = paraphs[i]
+ lastvalue = GaugeMeasure()
+ lastvalue.alarm = NotAvailable
+ if i == 0:
+ text = paraph.xpath('b/span/font[@size="4"]')[1].text
+ lastvalue.level = float(text.split('\n')[1].split(u'°')[0])
+ if i == 1:
+ text = paraph.xpath('b/span/font')[2].text
+ lastvalue.level = float(text.split('\n')[1])
+ if i == 2:
+ text = paraph.xpath('span/font/b')[0].text
+ lastvalue.level = float(text.split('\n')[2].split('hPa')[0])
+ if i == 3:
+ text = paraph.xpath('span/font[@size="4"]/b')[0].text
+ lastvalue.level = float(text.split('\n')[2].split(u'%')[0]\
+ .split(':')[1])
+ if i == 4:
+ text = paraph.xpath('b/font[@size="4"]/span')[0].text
+ lastvalue.level = float(text.split('\n')[0])
+ if i == 5:
+ text = paraph.xpath('b/font/span')[0].text
+ lastvalue.level = float(text.split('\n')[1])
+ if i == 6:
+ text = paraph.xpath('b/font[@size="4"]/span')[1].text
+ lastvalue.level = float(text.split(' ')[0])
+ sensor.lastvalue = lastvalue
+ sensors.append(sensor)
+ return sensors