[Revert if incompatible] ?time=&name= is for device, not sensor
This commit is contained in:
parent
9b08f8cb69
commit
5f1d0338c9
1 changed files with 9 additions and 2 deletions
11
models.py
11
models.py
|
@ -72,11 +72,18 @@ class Device:
|
||||||
|
|
||||||
for s in self.sensors:
|
for s in self.sensors:
|
||||||
res += f'&{s.mac}={s.value}'
|
res += f'&{s.mac}={s.value}'
|
||||||
|
# if s.time is not None:
|
||||||
|
# res += f'&time={s.time}'
|
||||||
|
# if s.name is not None:
|
||||||
|
# res += f'&name={quote(s.name)}'
|
||||||
|
|
||||||
|
if self.sensors:
|
||||||
|
s = self.sensors[0]
|
||||||
if s.time is not None:
|
if s.time is not None:
|
||||||
res += f'&time={s.time}'
|
res += f'&time={s.time}'
|
||||||
if s.name is not None:
|
|
||||||
res += f'&name={quote(s.name)}'
|
|
||||||
|
|
||||||
|
if self.name is not None:
|
||||||
|
res += '&name=' + quote(self.name)
|
||||||
if self.owner is not None:
|
if self.owner is not None:
|
||||||
res += '&owner=' + quote(self.owner)
|
res += '&owner=' + quote(self.owner)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue