aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/fan.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2021-03-01 14:57:40 -0500
committerKevin O'Connor <kevin@koconnor.net>2021-03-01 14:57:40 -0500
commit4d3d25b1f799e98e5c8a86b0a24e8507ecfb918e (patch)
tree4d7445b896d1eb5741b726bcb4131f9b7fa94717 /klippy/extras/fan.py
parent16d85d1a78bbd29d0177c98754b9a8ccb9f10b42 (diff)
downloadkutter-4d3d25b1f799e98e5c8a86b0a24e8507ecfb918e.tar.gz
kutter-4d3d25b1f799e98e5c8a86b0a24e8507ecfb918e.tar.xz
kutter-4d3d25b1f799e98e5c8a86b0a24e8507ecfb918e.zip
fan: Minor updates to tachometer handling
Add new fields to Command_Templates.md. Remove unused self.rpm variable. Use an explicit get_frequency() method in keeping with Klipper's convention of not "peeking into member variables". Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras/fan.py')
-rw-r--r--klippy/extras/fan.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/klippy/extras/fan.py b/klippy/extras/fan.py
index 13d9bcd7..83df80fe 100644
--- a/klippy/extras/fan.py
+++ b/klippy/extras/fan.py
@@ -12,7 +12,6 @@ class Fan:
self.printer = config.get_printer()
self.last_fan_value = 0.
self.last_fan_time = 0.
- self.rpm = None
# Read config
self.max_power = config.getfloat('max_power', 1., above=0., maxval=1.)
self.kick_start_time = config.getfloat('kick_start_time', 0.1,
@@ -84,8 +83,8 @@ class FanTachometer:
printer, pin, sample_time, poll_time)
def get_status(self, eventtime):
- if self._freq_counter:
- rpm = self._freq_counter.frequency * 30. / self.ppr
+ if self._freq_counter is not None:
+ rpm = self._freq_counter.get_frequency() * 30. / self.ppr
else:
rpm = None
return {'rpm': rpm}