There should be an instance of the class fan created.
Try going through the class tutorials on the forum that starts with this one
[Classes] Class Basics
also the python docs class tutorial
Try going through the class tutorials on the forum that starts with this one
[Classes] Class Basics
also the python docs class tutorial