Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
D
domotikad
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
domotika
domotikad
Commits
a60c9752
Commit
a60c9752
authored
Apr 15, 2014
by
nextime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ouch! make openweathermap to use metric units. Why the hell they are not the default?
parent
932725b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
weather.py
domotika/clouds/openweathermap/weather.py
+2
-2
No files found.
domotika/clouds/openweathermap/weather.py
View file @
a60c9752
...
...
@@ -56,9 +56,9 @@ class OWMWeather(object):
def
_getReport
(
self
):
log
.
debug
(
"Weather get report"
)
if
self
.
usecity
:
page
=
"http://api.openweathermap.org/data/2.5/weather?q="
+
str
(
self
.
city
)
page
=
"http://api.openweathermap.org/data/2.5/weather?q="
+
str
(
self
.
city
)
+
"&units=metric"
else
:
page
=
"http://api.openweathermap.org/data/2.5/weather?lat="
+
str
(
self
.
lat
)
+
"&lon="
+
str
(
self
.
lon
)
+
"&mode=json"
page
=
"http://api.openweathermap.org/data/2.5/weather?lat="
+
str
(
self
.
lat
)
+
"&lon="
+
str
(
self
.
lon
)
+
"&mode=json
&units=metric
"
cb
=
wu
.
getPage
(
page
,
headers
=
{
'x-api-key'
:
str
(
self
.
owmid
)})
.
addCallbacks
(
self
.
onData
,
self
.
onError
)
def
updateDatabase
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment