Skip to content

Commit

Permalink
🚀 5.0.2, #295
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinTail authored Aug 17, 2024
2 parents e3622bc + 52767e5 commit c4d9390
Show file tree
Hide file tree
Showing 6 changed files with 615 additions and 583 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Version 5

### 5.0.2

- Initial state for relays is `OFF` — fixes excessive switches on startup in most cases.

### 5.0.1

- Preventing installations on environments having unsupported Python versions:
Expand Down
2 changes: 1 addition & 1 deletion octoprint_octorelay/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Driver():
def __init__(self, pin: int, inverted: bool, pin_factory=None):
self.pin = pin # GPIO pin
self.inverted = inverted # marks the relay as normally closed
self.handle = LED(pin, pin_factory=pin_factory)
self.handle = LED(pin, pin_factory=pin_factory, initial_value=inverted)

def __repr__(self) -> str:
return f"{type(self).__name__}(pin={self.pin},inverted={self.inverted},closed={self.is_closed()})"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_constructor(self):
def test_serialization(self):
relay = Driver(18, True, MockFactory())
serialization = f"{relay}"
self.assertEqual(serialization, "Driver(pin=18,inverted=True,closed=True)")
self.assertEqual(serialization, "Driver(pin=18,inverted=True,closed=False)")

def test_close(self):
cases = [
Expand Down
21 changes: 10 additions & 11 deletions ui/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import tsPlugin from "typescript-eslint";
import prettierOverrides from "eslint-config-prettier";
import prettierRules from "eslint-plugin-prettier/recommended";
import unicornPlugin from "eslint-plugin-unicorn";
import importPlugin from "eslint-plugin-import";
import allowedDepsPlugin from "eslint-plugin-allowed-dependencies";

export default [
{
Expand All @@ -13,12 +13,7 @@ export default [
},
plugins: {
unicorn: unicornPlugin,
import: importPlugin,
},
settings: {
// "import-x" plugin installed as "import", in order to suppress the warning from the typescript resolver
// @link https://github.com/import-js/eslint-import-resolver-typescript/issues/293
"import-x/resolver": { typescript: true, node: true },
allowed: allowedDepsPlugin,
},
},
jsPlugin.configs.recommended,
Expand All @@ -30,17 +25,21 @@ export default [
// Things to turn on globally
{
rules: {
"import/named": "error",
"import/export": "error",
"import/no-duplicates": "warn",
"unicorn/prefer-node-protocol": "error",
},
},
// For the sources
{
files: ["model/*.ts", "helpers/*.ts"],
rules: {
"import/no-extraneous-dependencies": "error",
"allowed/dependencies": "error",
},
},
// For the tests
{
files: ["model/*.spec.ts", "helpers/*.spec.ts"],
rules: {
"allowed/dependencies": "off",
},
},
];
32 changes: 14 additions & 18 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,22 @@
},
"dependencies": {},
"devDependencies": {
"@tsconfig/node18": "^18.2.2",
"@types/jquery": "^3.5.22",
"@types/node": "^20.14.10",
"@vitest/coverage-istanbul": "^2.0.2",
"eslint": "^9.6.0",
"@tsconfig/node18": "^18.2.4",
"@types/jquery": "^3.5.30",
"@types/node": "^22.4.0",
"@vitest/coverage-istanbul": "^2.0.5",
"eslint": "^9.9.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "https://registry.npmjs.org/eslint-plugin-import-x/-/eslint-plugin-import-x-3.0.1.tgz",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-unicorn": "^54.0.0",
"eslint-plugin-allowed-dependencies": "^0.5.1",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-unicorn": "^55.0.0",
"happy-dom": "^14.12.3",
"mockdate": "^3.0.5",
"prettier": "3.3.2",
"sass": "^1.68.0",
"tsup": "^8.0.1",
"typescript": "^5.2.2",
"typescript-eslint": "^8.0.0-alpha.41",
"vitest": "^2.0.2"
},
"resolutions": {
"**/@typescript-eslint/utils": "^8.0.0-alpha.41"
"prettier": "3.3.3",
"sass": "^1.77.8",
"tsup": "^8.2.4",
"typescript": "^5.5.4",
"typescript-eslint": "^8.1.0",
"vitest": "^2.0.5"
}
}
Loading

0 comments on commit c4d9390

Please sign in to comment.