-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SW-4036 reset exhaust when external power plugged in (#1829)
* reset exhaust on external power change * set fallback usage to 0 * show ready to laser exhaust if no data received * add translation * replace image * fix spelling * remove airfilter serial from about page * improve event tests * fix maintenance test and move working area tests before settings so backlash/percission calibration will not be enabled
- Loading branch information
1 parent
3900ae0
commit 790457f
Showing
38 changed files
with
843 additions
and
466 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
class ExhaustModelInitializationError(Exception): | ||
pass | ||
|
||
|
||
class Device: | ||
# FOR PYTHON3 | ||
# dataset_type: int | ||
# ext_power: bool | ||
# ext_voltage: float | ||
# fan_power: float | ||
# mode: str | ||
# pressure: int | ||
# serial_num: int | ||
# smart_lock: bool | ||
# type: int | ||
|
||
def __init__( | ||
self, | ||
dataset_type, | ||
ext_power, | ||
ext_voltage, | ||
fan_power, | ||
mode, | ||
pressure, | ||
serial_num, | ||
smart_lock, | ||
type, | ||
): | ||
self.dataset_type = dataset_type | ||
self.ext_power = ext_power | ||
self.ext_voltage = ext_voltage | ||
self.fan_power = fan_power | ||
self.mode = mode | ||
self.pressure = pressure | ||
self.serial_num = serial_num | ||
self.smart_lock = smart_lock | ||
self.type = type | ||
|
||
@staticmethod | ||
# FOR PYTHON3 | ||
# def from_dict(dictonary: dict) -> Device: | ||
def from_dict(dictonary): | ||
""" | ||
Creates a Device object from a dict. | ||
Args: | ||
dictonary (dict): dict with the device data | ||
Returns: | ||
Device: Device object | ||
""" | ||
try: | ||
return Device( | ||
dictonary.get("dataset_type"), | ||
dictonary.get("ext_power"), | ||
dictonary.get("ext_voltage"), | ||
dictonary.get("fan_power"), | ||
dictonary.get("mode"), | ||
dictonary.get("pressure"), | ||
dictonary.get("serial_num"), | ||
dictonary.get("smart_lock"), | ||
dictonary.get("type"), | ||
) | ||
except TypeError as e: | ||
raise ExhaustModelInitializationError( | ||
"Can't init device from dict: {} - e:{}".format(dictonary, e) | ||
) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.