You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
official docs example:
...
for sensor in pollen_sensors:
client.command(
"INSERT INTO PollenSensor "
"('device_id', 'read_time', 'read') "
"VALUES('%s', '%s', %s')"
% (sensor.get_id()
time.now(),
sensor.get_data()))
...
but I test it in Python3.7 Pycharm run with Python console, I find ('device_id', 'read_time', 'read') will return error. Only if remove ‘ ’ it will have proper execution.
correct:
...
for sensor in pollen_sensors:
client.command(
"INSERT INTO PollenSensor "
"(device_id, read_time, read) "
"VALUES('%s', '%s', %s')"
% (sensor.get_id()
time.now(),
sensor.get_data()))
...
So maybe the example is wrong.
The text was updated successfully, but these errors were encountered:
official docs example:
...
for sensor in pollen_sensors:
client.command(
"INSERT INTO PollenSensor "
"('device_id', 'read_time', 'read') "
"VALUES('%s', '%s', %s')"
% (sensor.get_id()
time.now(),
sensor.get_data()))
...
but I test it in Python3.7 Pycharm run with Python console, I find ('device_id', 'read_time', 'read') will return error. Only if remove ‘ ’ it will have proper execution.
correct:
...
for sensor in pollen_sensors:
client.command(
"INSERT INTO PollenSensor "
"(device_id, read_time, read) "
"VALUES('%s', '%s', %s')"
% (sensor.get_id()
time.now(),
sensor.get_data()))
...
So maybe the example is wrong.
The text was updated successfully, but these errors were encountered: