Skip to content
This repository was archived by the owner on Jul 25, 2025. It is now read-only.

Conversation

mahadi
Copy link

@mahadi mahadi commented Apr 15, 2018

When removing a sensor from the bus, reading it would result in an import error in _update_sensor_data:

Traceback (most recent call last):
  File "ow_monitor.py", line 18, in <module>
    main()
  File "ow_monitor.py", line 13, in main
    t = ds.temperature()
  File "/usr/local/lib/python3.5/dist-packages/sensor/DS18B20.py", line 40, in temperature
    self._update()
  File "/usr/local/lib/python3.5/dist-packages/sensor/__init__.py", line 103, in _update
    self._update_callback(**kwargs)
  File "/usr/local/lib/python3.5/dist-packages/sensor/__init__.py", line 63, in locked
    func(*args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/sensor/DS18B20.py", line 52, in _update_sensor_data
    time.sleep(0.2)
NameError: name 'time' is not defined

fixed missing import of time
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant