keptenkurk / BS440

Python code to talk to Medisana BS440 bluetooth enabled bathroom scale
MIT License
50 stars 34 forks source link

InfluxDB Plugin: AttributeError: 'module' object has no attribute 'timezone' #100

Closed guuurb closed 3 years ago

guuurb commented 3 years ago

Hello there,

For a project i am trying to use the influxdb plugin. It worked one time and it now throws this error.

How can i fix this issue?

Traceback (most recent call last): File "BS440.py", line 323, in <module> plugin.execute(config, persondata, weightdatasorted, bodydatasorted) File "plugins/BS440influxdb.py", line 71, in execute last_time = self.timestamp_from_resultset(next(rs.get_points())) File "plugins/BS440influxdb.py", line 51, in timestamp_from_resultset d = d.replace(tzinfo=dt.timezone.utc) AttributeError: 'module' object has no attribute 'timezone'

guuurb commented 3 years ago

After a lot of error chasing it's working.

The influxdb plugin is built for Python 3 and not for 2.7 like BS440.py. We had to:

  1. Install various modules using pip3
  2. Change around some configparser stuff to be python3 compatible
  3. Change maxint to maxsize

After this is seems to be working.