1
1
# coding=utf-8
2
2
from __future__ import absolute_import
3
3
4
- import flask
5
4
import octoprint .plugin
6
5
7
6
from .fse_version import VERSION as __version__ # noqa: F401
8
7
from .hx711 import HX711
9
8
10
9
try :
11
- import RPi . GPIO as GPIO
10
+ from RPi import GPIO
12
11
except (ModuleNotFoundError , RuntimeError ):
13
- import Mock . GPIO as GPIO # noqa: F401
12
+ from Mock import GPIO # noqa: F401
14
13
15
14
16
15
# pylint: disable=too-many-ancestors
@@ -26,27 +25,27 @@ class FilamentScalePlugin(
26
25
tq = None
27
26
28
27
@staticmethod
29
- def get_template_configs ():
30
- return [dict ( type = " settings" , custom_bindings = True ) ]
28
+ def get_template_configs (): # pylint: disable=arguments-differ
29
+ return [{ " type" : " settings" , " custom_bindings" : True } ]
31
30
32
31
@staticmethod
33
- def get_settings_defaults ():
34
- return dict (
35
- tare = 8430152 ,
36
- reference_unit = - 411 ,
37
- spool_weight = 200 ,
38
- clockpin = 21 ,
39
- datapin = 20 ,
40
- lastknownweight = 0 ,
41
- )
32
+ def get_settings_defaults (): # pylint: disable=arguments-differ
33
+ return {
34
+ " tare" : 8430152 ,
35
+ " reference_unit" : - 411 ,
36
+ " spool_weight" : 200 ,
37
+ " clockpin" : 21 ,
38
+ " datapin" : 20 ,
39
+ " lastknownweight" : 0 ,
40
+ }
42
41
43
42
@staticmethod
44
- def get_assets ():
45
- return dict (
46
- js = ["js/filament_scale.js" ],
47
- css = ["css/filament_scale.css" ],
48
- less = ["less/filament_scale.less" ],
49
- )
43
+ def get_assets (): # pylint: disable=arguments-differ
44
+ return {
45
+ "js" : ["js/filament_scale.js" ],
46
+ " css" : ["css/filament_scale.css" ],
47
+ " less" : ["less/filament_scale.less" ],
48
+ }
50
49
51
50
def __init__ (self ):
52
51
super ().__init__ ()
@@ -113,10 +112,10 @@ def check_weight(self):
113
112
self .last_weight = v
114
113
self ._plugin_manager .send_plugin_message (self ._identifier , v )
115
114
self .hx .power_down ()
116
- except Exception as err :
115
+ except Exception as err : # pylint: disable=broad-exception-caught
117
116
self ._logger .exception (err )
118
117
119
- # pylint: disable=line-too-long
118
+ # pylint: disable=line-too-long,use-dict-literal
120
119
def get_update_information (self ):
121
120
# Define the configuration for your plugin to use with the
122
121
# Software Update Plugin here.
0 commit comments