From b02558b3f558b75e208895a67daacf8cb71460d0 Mon Sep 17 00:00:00 2001 From: Scott Gibb Date: Sat, 18 Nov 2023 12:27:48 +0000 Subject: [PATCH 01/22] Addng more linters and test D --- .github/workflows/Static Analysis.yml | 12 +- .markdownlint.json | 7 + .pylintrc | 630 ++++++++++++++++++++++++++ PrusaPrint/setupOctoprint.sh | 2 +- PrusaPrint/testDHT11.py | 37 ++ yamllint.yaml | 35 ++ 6 files changed, 721 insertions(+), 2 deletions(-) create mode 100644 .markdownlint.json create mode 100644 .pylintrc create mode 100644 PrusaPrint/testDHT11.py create mode 100644 yamllint.yaml diff --git a/.github/workflows/Static Analysis.yml b/.github/workflows/Static Analysis.yml index 5ffb050..6f1f893 100644 --- a/.github/workflows/Static Analysis.yml +++ b/.github/workflows/Static Analysis.yml @@ -43,4 +43,14 @@ run: | echo "Checking YAML files" yamllint -c .yamllint.yaml .github/**/**.yaml - yamllint -c .yamllint.yaml **/**/**.yml \ No newline at end of file + yamllint -c .yamllint.yaml **/**/**.yml + + Python_Lint_Check: + name: Python Lint Check + runs-on: ubuntu-latest + steps: + - name: Install pylint + run: sudo apt-get install pip -y + pip install pylint + - name: Run Pylint + run: pylint --fail-under=4 **/*.py \ No newline at end of file diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 0000000..cec4996 --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,7 @@ +{ + "line-length": { + "line_length": 800, + "code_blocks": false, + "tables": true + } +} \ No newline at end of file diff --git a/.pylintrc b/.pylintrc new file mode 100644 index 0000000..39c580b --- /dev/null +++ b/.pylintrc @@ -0,0 +1,630 @@ +[MAIN] + +# Analyse import fallback blocks. This can be used to support both Python 2 and +# 3 compatible code, which means that the block might have code that exists +# only in one or another interpreter, leading to false positives when analysed. +analyse-fallback-blocks=no + +# Clear in-memory caches upon conclusion of linting. Useful if running pylint +# in a server-like mode. +clear-cache-post-run=no + +# Load and enable all available extensions. Use --list-extensions to see a list +# all available extensions. +#enable-all-extensions= + +# In error mode, messages with a category besides ERROR or FATAL are +# suppressed, and no reports are done by default. Error mode is compatible with +# disabling specific errors. +#errors-only= + +# Always return a 0 (non-error) status code, even if lint errors are found. +# This is primarily useful in continuous integration scripts. +#exit-zero= + +# A comma-separated list of package or module names from where C extensions may +# be loaded. Extensions are loading into the active Python interpreter and may +# run arbitrary code. +extension-pkg-allow-list= + +# A comma-separated list of package or module names from where C extensions may +# be loaded. Extensions are loading into the active Python interpreter and may +# run arbitrary code. (This is an alternative name to extension-pkg-allow-list +# for backward compatibility.) +extension-pkg-whitelist= + +# Return non-zero exit code if any of these messages/categories are detected, +# even if score is above --fail-under value. Syntax same as enable. Messages +# specified are enabled, while categories only check already-enabled messages. +fail-on= + +# Specify a score threshold under which the program will exit with error. +fail-under=10 + +# Interpret the stdin as a python script, whose filename needs to be passed as +# the module_or_package argument. +#from-stdin= + +# Files or directories to be skipped. They should be base names, not paths. +ignore=CVS + +# Add files or directories matching the regular expressions patterns to the +# ignore-list. The regex matches against paths and can be in Posix or Windows +# format. Because '\\' represents the directory delimiter on Windows systems, +# it can't be used as an escape character. +ignore-paths= + +# Files or directories matching the regular expression patterns are skipped. +# The regex matches against base names, not paths. The default value ignores +# Emacs file locks +ignore-patterns=^\.# + +# List of module names for which member attributes should not be checked +# (useful for modules/projects where namespaces are manipulated during runtime +# and thus existing member attributes cannot be deduced by static analysis). It +# supports qualified module names, as well as Unix pattern matching. +ignored-modules= + +# Python code to execute, usually for sys.path manipulation such as +# pygtk.require(). +init-hook= 'import sys; sys.path.append("src/")' + +# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the +# number of processors available to use, and will cap the count on Windows to +# avoid hangs. +jobs=1 + +# Control the amount of potential inferred values when inferring a single +# object. This can help the performance when dealing with large functions or +# complex, nested conditions. +limit-inference-results=100 + +# List of plugins (as comma separated values of python module names) to load, +# usually to register additional checkers. +load-plugins= + +# Pickle collected data for later comparisons. +persistent=yes + +# Minimum Python version to use for version dependent checks. Will default to +# the version used to run pylint. +py-version=3.10 + +# Discover python modules and packages in the file system subtree. +recursive=no + +# Add paths to the list of the source roots. Supports globbing patterns. The +# source root is an absolute path or a path relative to the current working +# directory used to determine a package namespace for modules located under the +# source root. + +# When enabled, pylint would attempt to guess common misconfiguration and emit +# user-friendly hints instead of false-positive error messages. +suggestion-mode=yes + +# Allow loading of arbitrary C extensions. Extensions are imported into the +# active Python interpreter and may run arbitrary code. +unsafe-load-any-extension=no + +# In verbose mode, extra non-checker-related info will be displayed. +#verbose= + + +[BASIC] + +# Naming style matching correct argument names. +argument-naming-style=snake_case + +# Regular expression matching correct argument names. Overrides argument- +# naming-style. If left empty, argument names will be checked with the set +# naming style. +#argument-rgx= + +# Naming style matching correct attribute names. +attr-naming-style=snake_case + +# Regular expression matching correct attribute names. Overrides attr-naming- +# style. If left empty, attribute names will be checked with the set naming +# style. +#attr-rgx= + +# Bad variable names which should always be refused, separated by a comma. +bad-names=foo, + bar, + baz, + toto, + tutu, + tata + +# Bad variable names regexes, separated by a comma. If names match any regex, +# they will always be refused +bad-names-rgxs= + +# Naming style matching correct class attribute names. +class-attribute-naming-style=any + +# Regular expression matching correct class attribute names. Overrides class- +# attribute-naming-style. If left empty, class attribute names will be checked +# with the set naming style. +#class-attribute-rgx= + +# Naming style matching correct class constant names. +class-const-naming-style=UPPER_CASE + +# Regular expression matching correct class constant names. Overrides class- +# const-naming-style. If left empty, class constant names will be checked with +# the set naming style. +#class-const-rgx= + +# Naming style matching correct class names. +class-naming-style=PascalCase + +# Regular expression matching correct class names. Overrides class-naming- +# style. If left empty, class names will be checked with the set naming style. +#class-rgx= + +# Naming style matching correct constant names. +const-naming-style=UPPER_CASE + +# Regular expression matching correct constant names. Overrides const-naming- +# style. If left empty, constant names will be checked with the set naming +# style. +#const-rgx= + +# Minimum line length for functions/classes that require docstrings, shorter +# ones are exempt. +docstring-min-length=-1 + +# Naming style matching correct function names. +function-naming-style=snake_case + +# Regular expression matching correct function names. Overrides function- +# naming-style. If left empty, function names will be checked with the set +# naming style. +#function-rgx= + +# Good variable names which should always be accepted, separated by a comma. +good-names=i, + j, + k, + ex, + Run, + _ + +# Good variable names regexes, separated by a comma. If names match any regex, +# they will always be accepted +good-names-rgxs= + +# Include a hint for the correct naming format with invalid-name. +include-naming-hint=no + +# Naming style matching correct inline iteration names. +inlinevar-naming-style=any + +# Regular expression matching correct inline iteration names. Overrides +# inlinevar-naming-style. If left empty, inline iteration names will be checked +# with the set naming style. +#inlinevar-rgx= + +# Naming style matching correct method names. +method-naming-style=snake_case + +# Regular expression matching correct method names. Overrides method-naming- +# style. If left empty, method names will be checked with the set naming style. +#method-rgx= + +# Naming style matching correct module names. +module-naming-style=snake_case + +# Regular expression matching correct module names. Overrides module-naming- +# style. If left empty, module names will be checked with the set naming style. +#module-rgx= + +# Colon-delimited sets of names that determine each other's naming style when +# the name regexes allow several styles. +name-group= + +# Regular expression which should only match function or class names that do +# not require a docstring. +no-docstring-rgx=^_ + +# List of decorators that produce properties, such as abc.abstractproperty. Add +# to this list to register other decorators that produce valid properties. +# These decorators are taken in consideration only for invalid-name. +property-classes=abc.abstractproperty + +# Regular expression matching correct type alias names. If left empty, type +# alias names will be checked with the set naming style. +#typealias-rgx= + +# Regular expression matching correct type variable names. If left empty, type +# variable names will be checked with the set naming style. +#typevar-rgx= + +# Naming style matching correct variable names. +variable-naming-style=snake_case + +# Regular expression matching correct variable names. Overrides variable- +# naming-style. If left empty, variable names will be checked with the set +# naming style. +#variable-rgx= + + +[CLASSES] + +# Warn about protected attribute access inside special methods +check-protected-access-in-special-methods=no + +# List of method names used to declare (i.e. assign) instance attributes. +defining-attr-methods=__init__, + __new__, + setUp, + asyncSetUp, + __post_init__ + +# List of member names, which should be excluded from the protected access +# warning. +exclude-protected=_asdict,_fields,_replace,_source,_make,os._exit + +# List of valid names for the first argument in a class method. +valid-classmethod-first-arg=cls + +# List of valid names for the first argument in a metaclass class method. +valid-metaclass-classmethod-first-arg=mcs + + +[DESIGN] + +# List of regular expressions of class ancestor names to ignore when counting +# public methods (see R0903) +exclude-too-few-public-methods= + +# List of qualified class names to ignore when counting class parents (see +# R0901) +ignored-parents= + +# Maximum number of arguments for function / method. +max-args=5 + +# Maximum number of attributes for a class (see R0902). +max-attributes=7 + +# Maximum number of boolean expressions in an if statement (see R0916). +max-bool-expr=5 + +# Maximum number of branch for function / method body. +max-branches=12 + +# Maximum number of locals for function / method body. +max-locals=15 + +# Maximum number of parents for a class (see R0901). +max-parents=7 + +# Maximum number of public methods for a class (see R0904). +max-public-methods=20 + +# Maximum number of return / yield for function / method body. +max-returns=6 + +# Maximum number of statements in function / method body. +max-statements=50 + +# Minimum number of public methods for a class (see R0903). +min-public-methods=2 + + +[EXCEPTIONS] + +# Exceptions that will emit a warning when caught. +overgeneral-exceptions=builtins.BaseException,builtins.Exception + + +[FORMAT] + +# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. +expected-line-ending-format= + +# Regexp for a line that is allowed to be longer than the limit. +ignore-long-lines=^\s*(# )??$ + +# Number of spaces of indent required inside a hanging or continued line. +indent-after-paren=4 + +# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 +# tab). +indent-string=' ' + +# Maximum number of characters on a single line. +max-line-length=200 + +# Maximum number of lines in a module. +max-module-lines=1000 + +# Allow the body of a class to be on the same line as the declaration if body +# contains single statement. +single-line-class-stmt=no + +# Allow the body of an if to be on the same line as the test if there is no +# else. +single-line-if-stmt=no + + +[IMPORTS] + +# List of modules that can be imported at any level, not just the top level +# one. +allow-any-import-level=yes + +# Allow explicit reexports by alias from a package __init__. +allow-reexport-from-package=no + +# Allow wildcard imports from modules that define __all__. +allow-wildcard-with-all=no + +# Deprecated modules which should not be used, separated by a comma. +deprecated-modules= + +# Output a graph (.gv or any supported image format) of external dependencies +# to the given file (report RP0402 must not be disabled). +ext-import-graph= + +# Output a graph (.gv or any supported image format) of all (i.e. internal and +# external) dependencies to the given file (report RP0402 must not be +# disabled). +import-graph= + +# Output a graph (.gv or any supported image format) of internal dependencies +# to the given file (report RP0402 must not be disabled). +int-import-graph= + +# Force import order to recognize a module as part of the standard +# compatibility libraries. +known-standard-library= + +# Force import order to recognize a module as part of a third party library. +known-third-party=enchant + +# Couples of modules and preferred modules, separated by a comma. +preferred-modules= + + +[LOGGING] + +# The type of string formatting that logging methods do. `old` means using % +# formatting, `new` is for `{}` formatting. +logging-format-style=new + +# Logging modules to check that the string format arguments are in logging +# function parameter format. +logging-modules=logging + + +[MESSAGES CONTROL] + +# Only show warnings with the listed confidence levels. Leave empty to show +# all. Valid levels: HIGH, CONTROL_FLOW, INFERENCE, INFERENCE_FAILURE, +# UNDEFINED. +confidence=HIGH, + CONTROL_FLOW, + INFERENCE, + INFERENCE_FAILURE, + UNDEFINED + +# Disable the message, report, category or checker with the given id(s). You +# can either give multiple identifiers separated by comma (,) or put this +# option multiple times (only on the command line, not in the configuration +# file where it should appear only once). You can also use "--disable=all" to +# disable everything first and then re-enable specific checks. For example, if +# you want to run only the similarities checker, you can use "--disable=all +# --enable=similarities". If you want to run only the classes checker, but have +# no Warning level messages displayed, use "--disable=all --enable=classes +# --disable=W". +disable=raw-checker-failed, + bad-inline-option, + locally-disabled, + file-ignored, + suppressed-message, + useless-suppression, + deprecated-pragma, + use-symbolic-message-instead + +# Enable the message, report, category or checker with the given id(s). You can +# either give multiple identifier separated by comma (,) or put this option +# multiple time (only on the command line, not in the configuration file where +# it should appear only once). See also the "--disable" option for examples. +enable= + + +[METHOD_ARGS] + +# List of qualified names (i.e., library.method) which require a timeout +# parameter e.g. 'requests.api.get,requests.api.post' +timeout-methods=requests.api.delete,requests.api.get,requests.api.head,requests.api.options,requests.api.patch,requests.api.post,requests.api.put,requests.api.request + + +[MISCELLANEOUS] + +# List of note tags to take in consideration, separated by a comma. +notes=FIXME, + XXX, + TODO + +# Regular expression of note tags to take in consideration. +notes-rgx= + + +[REFACTORING] + +# Maximum number of nested blocks for function / method body +max-nested-blocks=5 + +# Complete name of functions that never returns. When checking for +# inconsistent-return-statements if a never returning function is called then +# it will be considered as an explicit return statement and no message will be +# printed. +never-returning-functions=sys.exit,argparse.parse_error + + +[REPORTS] + +# Python expression which should return a score less than or equal to 10. You +# have access to the variables 'fatal', 'error', 'warning', 'refactor', +# 'convention', and 'info' which contain the number of messages in each +# category, as well as 'statement' which is the total number of statements +# analyzed. This score is used by the global evaluation report (RP0004). +evaluation=max(0, 0 if fatal else 10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)) + +# Template used to display messages. This is a python new-style format string +# used to format the message information. See doc for all details. +msg-template= + +# Set the output format. Available formats are text, parseable, colorized, json +# and msvs (visual studio). You can also give a reporter class, e.g. +# mypackage.mymodule.MyReporterClass. +#output-format= + +# Tells whether to display a full report or only the messages. +reports=no + +# Activate the evaluation score. +score=yes + + +[SIMILARITIES] + +# Comments are removed from the similarity computation +ignore-comments=yes + +# Docstrings are removed from the similarity computation +ignore-docstrings=yes + +# Imports are removed from the similarity computation +ignore-imports=yes + +# Signatures are removed from the similarity computation +ignore-signatures=yes + +# Minimum lines number of a similarity. +min-similarity-lines=4 + + +[SPELLING] + +# Limits count of emitted suggestions for spelling mistakes. +max-spelling-suggestions=4 + +# Spelling dictionary name. Available dictionaries: en (aspell), en_AU +# (aspell), en_CA (aspell), en_GB (aspell), en_US (aspell). +spelling-dict= + +# List of comma separated words that should be considered directives if they +# appear at the beginning of a comment and should not be checked. +spelling-ignore-comment-directives=fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy: + +# List of comma separated words that should not be checked. +spelling-ignore-words= + +# A path to a file that contains the private dictionary; one word per line. +spelling-private-dict-file= + +# Tells whether to store unknown words to the private dictionary (see the +# --spelling-private-dict-file option) instead of raising a message. +spelling-store-unknown-words=no + + +[STRING] + +# This flag controls whether inconsistent-quotes generates a warning when the +# character used as a quote delimiter is used inconsistently within a module. +check-quote-consistency=no + +# This flag controls whether the implicit-str-concat should generate a warning +# on implicit string concatenation in sequences defined over several lines. +check-str-concat-over-line-jumps=no + + +[TYPECHECK] + +# List of decorators that produce context managers, such as +# contextlib.contextmanager. Add to this list to register other decorators that +# produce valid context managers. +contextmanager-decorators=contextlib.contextmanager + +# List of members which are set dynamically and missed by pylint inference +# system, and so shouldn't trigger E1101 when accessed. Python regular +# expressions are accepted. +generated-members= + +# Tells whether to warn about missing members when the owner of the attribute +# is inferred to be None. +ignore-none=yes + +# This flag controls whether pylint should warn about no-member and similar +# checks whenever an opaque object is returned when inferring. The inference +# can return multiple potential results while evaluating a Python object, but +# some branches might not be evaluated, which results in partial inference. In +# that case, it might be useful to still emit no-member and other checks for +# the rest of the inferred objects. +ignore-on-opaque-inference=yes + +# List of symbolic message names to ignore for Mixin members. +ignored-checks-for-mixins=no-member, + not-async-context-manager, + not-context-manager, + attribute-defined-outside-init + +# List of class names for which member attributes should not be checked (useful +# for classes with dynamically set attributes). This supports the use of +# qualified names. +ignored-classes=optparse.Values,thread._local,_thread._local,argparse.Namespace + +# Show a hint with possible names when a member name was not found. The aspect +# of finding the hint is based on edit distance. +missing-member-hint=yes + +# The minimum edit distance a name should have in order to be considered a +# similar match for a missing member name. +missing-member-hint-distance=1 + +# The total number of similar names that should be taken in consideration when +# showing a hint for a missing member. +missing-member-max-choices=1 + +# Regex pattern to define which classes are considered mixins. +mixin-class-rgx=.*[Mm]ixin + +# List of decorators that change the signature of a decorated function. +signature-mutators= + + +[VARIABLES] + +# List of additional names supposed to be defined in builtins. Remember that +# you should avoid defining new builtins when possible. +additional-builtins= + +# Tells whether unused global variables should be treated as a violation. +allow-global-unused-variables=yes + +# List of names allowed to shadow builtins +allowed-redefined-builtins= + +# List of strings which can identify a callback function by name. A callback +# name must start or end with one of those strings. +callbacks=cb_, + _cb + +# A regular expression matching the name of dummy variables (i.e. expected to +# not be used). +dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ + +# Argument names that match this expression will be ignored. +ignored-argument-names=_.*|^ignored_|^unused_ + +# Tells whether we should check for unused import in __init__ files. +init-import=no + +# List of qualified module names which can have objects that can redefine +# builtins. +redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io \ No newline at end of file diff --git a/PrusaPrint/setupOctoprint.sh b/PrusaPrint/setupOctoprint.sh index b154b86..f8e36b5 100644 --- a/PrusaPrint/setupOctoprint.sh +++ b/PrusaPrint/setupOctoprint.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # Setup Script for downloading the LED Strip Controller Script current_dir=$(pwd) diff --git a/PrusaPrint/testDHT11.py b/PrusaPrint/testDHT11.py new file mode 100644 index 0000000..3bc89be --- /dev/null +++ b/PrusaPrint/testDHT11.py @@ -0,0 +1,37 @@ +# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries +# SPDX-License-Identifier: MIT + +import time +import board +import adafruit_dht + +# Initial the dht device, with data pin connected to: +dhtDevice = adafruit_dht.DHT11(board.D18) + +# you can pass DHT22 use_pulseio=False if you wouldn't like to use pulseio. +# This may be necessary on a Linux single board computer like the Raspberry Pi, +# but it will not work in CircuitPython. +# dhtDevice = adafruit_dht.DHT22(board.D18, use_pulseio=False) + +while True: + try: + # Print the values to the serial port + temperature_c = dhtDevice.temperature + temperature_f = temperature_c * (9 / 5) + 32 + humidity = dhtDevice.humidity + print( + "Temp: {:.1f} F / {:.1f} C Humidity: {}% ".format( + temperature_f, temperature_c, humidity + ) + ) + + except RuntimeError as error: + # Errors happen fairly often, DHT's are hard to read, just keep going + print(error.args[0]) + time.sleep(2.0) + continue + except Exception as error: + dhtDevice.exit() + raise error + + time.sleep(2.0) diff --git a/yamllint.yaml b/yamllint.yaml new file mode 100644 index 0000000..eed2490 --- /dev/null +++ b/yamllint.yaml @@ -0,0 +1,35 @@ +--- + +yaml-files: + - '*.yaml' + - '*.yml' + - '.yamllint' + +rules: + braces: enable + brackets: enable + colons: enable + commas: enable + comments: + level: warning + comments-indentation: + level: warning + document-end: disable + document-start: + level: warning + empty-lines: enable + empty-values: disable + hyphens: enable + indentation: enable + key-duplicates: enable + key-ordering: disable + line-length: + max: 120 + level: warning + new-line-at-end-of-file: enable + new-lines: enable + octal-values: disable + quoted-strings: disable + trailing-spaces: enable + truthy: + level: warning \ No newline at end of file From c619490dad59eb8b9a0236c29821b59aeffc7502 Mon Sep 17 00:00:00 2001 From: Scott Gibb Date: Sat, 18 Nov 2023 12:53:28 +0000 Subject: [PATCH 02/22] Adding camera config --- PrusaPrint/libcamera.conf | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 PrusaPrint/libcamera.conf diff --git a/PrusaPrint/libcamera.conf b/PrusaPrint/libcamera.conf new file mode 100644 index 0000000..06e08ee --- /dev/null +++ b/PrusaPrint/libcamera.conf @@ -0,0 +1,34 @@ +### Options for libcamera based cameras (PiCam, Arducam, ...) + +# The port on which the webcam server for the camera should listen on. If you have only +# one camera, leave at 8080. If you have more, change to 8081, 8082, etc. The primary +# camera will be considered the one with 8080. +PORT=8080 + +# The resolution to request on the camera sensor. Defaults to 1280x720. +#WIDTH=1920 +#HEIGHT=1080 + +WIDTH=3840 +HEIGHT=2160 + + +# The height to use for the video stream. Defaults to 720. +#VIDEO_HEIGHT=720 + +VIDEO_HEIGHT=2160 + +# The height to use for the snapshots. Defaults to 1080. +#SNAPSHOT_HEIGHT=1080 + +SNAPSHOT_HEIGHT=2160 + +# The framerate to set on the camera. Defaults to 15fps. +FRAMERATE=15 + +# Additional options. By default enables continuous auto focus (if possible). +#OPTIONS='--camera-options="AfMode=2" --camera-options="AfRange=2"' +OPTIONS='--camera-options="AfMode=0" --camera-options="LensPosition=1" + + + From eb64277fc3fa7fec88ab21ce2d62ebe815b49076 Mon Sep 17 00:00:00 2001 From: Scott Gibb Date: Sat, 18 Nov 2023 12:56:41 +0000 Subject: [PATCH 03/22] Adding libcamera.conf --- PrusaPrint/setupOctoprint.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PrusaPrint/setupOctoprint.sh b/PrusaPrint/setupOctoprint.sh index f8e36b5..5468af1 100644 --- a/PrusaPrint/setupOctoprint.sh +++ b/PrusaPrint/setupOctoprint.sh @@ -19,3 +19,8 @@ echo "Setup Complete" echo "Installing telegram dependencies" apt-get install cpulimit -y echo "Finished Installation" + +# Installing Libcamera.conf +echo "Copying over libcamera config" +cp libcamera.conf /boot/camera-streamer/libcamera.conf +echo "Finsihing Libcamera config" From 9d916d61e55b8205922c87bf8d4500af4b589f58 Mon Sep 17 00:00:00 2001 From: Scott Gibb Date: Sat, 18 Nov 2023 17:13:26 +0000 Subject: [PATCH 04/22] Added Some prusaprint settings --- PrusaPrint/getDHTTemp.py | 43 ++++++++++++++++++++++++++++++++++++ PrusaPrint/setupOctoprint.sh | 10 +++++++++ 2 files changed, 53 insertions(+) create mode 100644 PrusaPrint/getDHTTemp.py diff --git a/PrusaPrint/getDHTTemp.py b/PrusaPrint/getDHTTemp.py new file mode 100644 index 0000000..eaf6134 --- /dev/null +++ b/PrusaPrint/getDHTTemp.py @@ -0,0 +1,43 @@ +import sys +import time +import board +import adafruit_dht + +# Parse command line parameters. +sensor_args = { + '11': adafruit_dht.DHT11, + '22': adafruit_dht.DHT22, + '2302': adafruit_dht.DHT22 + } + +if len(sys.argv) == 3 and sys.argv[1] in sensor_args: + sensor = sensor_args[sys.argv[1]] + pin = "D%s" % sys.argv[2] + pin = getattr(board,pin) +else: + sys.exit(1) + +dhtDevice = sensor(pin) + +# DHT sensor read fails quite often, causing enclosure plugin to report value of 0. +# If this happens, retry as suggested in the adafruit_dht docs. +max_retries = 3 +retry_count = 0 +while retry_count <= max_retries: +# try: + if True: + humidity=dhtDevice.humidity + temperature=dhtDevice.temperature + + if humidity is not None and temperature is not None: + print(('{0:0.1f} | {1:0.1f}'.format(temperature, humidity))) + sys.exit(1) +# except Exception as e: +# print('-1 | -1') +# sys.exit(1) + + time.sleep(1) + retry_count += 1 + +print('-1 | -1') +sys.exit(1) diff --git a/PrusaPrint/setupOctoprint.sh b/PrusaPrint/setupOctoprint.sh index 5468af1..36db452 100644 --- a/PrusaPrint/setupOctoprint.sh +++ b/PrusaPrint/setupOctoprint.sh @@ -1,6 +1,9 @@ #!/bin/sh # Setup Script for downloading the LED Strip Controller Script + +echo "Starting OCtoprint Install" + current_dir=$(pwd) echo "Navigating to Home Directory" cd /home/pi || { echo "Failed to navigate to /home/pi. Exiting."; exit 1; } @@ -24,3 +27,10 @@ echo "Finished Installation" echo "Copying over libcamera config" cp libcamera.conf /boot/camera-streamer/libcamera.conf echo "Finsihing Libcamera config" + +# Overwriting getDHTTemp.py +echo "Overwriting getDHTTemp.py" +cp -rf getDHTTemp.py ~/oprint/lib/python3.9/site-packages/octoprint_enclosure/getDHTTemp.py +echo "Finished Overwriting getDHTTemp.py" + +echo "Finished, octoprint setup" \ No newline at end of file From 12eaa496f907ba856b5cb7da452dbe1603b9915c Mon Sep 17 00:00:00 2001 From: Scott Gibb Date: Sat, 18 Nov 2023 17:13:59 +0000 Subject: [PATCH 05/22] up to date wifi connect --- utils/wifi-connect | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/wifi-connect b/utils/wifi-connect index 7255e43..e92157b 160000 --- a/utils/wifi-connect +++ b/utils/wifi-connect @@ -1 +1 @@ -Subproject commit 7255e4361ddfbabed4aa81b4c737b8fb4607811f +Subproject commit e92157b76d88dfd7282a5a33310e7196acf08a6e From 9432cd93551883322c338fce0cf2116203e00985 Mon Sep 17 00:00:00 2001 From: Scott Gibb Date: Sat, 18 Nov 2023 17:20:39 +0000 Subject: [PATCH 06/22] adding updated static analysis and markdown fixes --- .github/workflows/Static Analysis.yml | 10 ++++++---- yamllint.yaml => .yamllint.yaml | 0 ReadMe.md | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) rename yamllint.yaml => .yamllint.yaml (100%) diff --git a/.github/workflows/Static Analysis.yml b/.github/workflows/Static Analysis.yml index 6f1f893..02a4816 100644 --- a/.github/workflows/Static Analysis.yml +++ b/.github/workflows/Static Analysis.yml @@ -42,7 +42,7 @@ - name: Run yamllint run: | echo "Checking YAML files" - yamllint -c .yamllint.yaml .github/**/**.yaml + yamllint -c .yamllint.yaml .github/**/**.yml yamllint -c .yamllint.yaml **/**/**.yml Python_Lint_Check: @@ -50,7 +50,9 @@ runs-on: ubuntu-latest steps: - name: Install pylint - run: sudo apt-get install pip -y - pip install pylint + run: | + pip install pylint - name: Run Pylint - run: pylint --fail-under=4 **/*.py \ No newline at end of file + run: | + echo "Checking source files with pylint" + pylint --fail-under=4 **/*.py \ No newline at end of file diff --git a/yamllint.yaml b/.yamllint.yaml similarity index 100% rename from yamllint.yaml rename to .yamllint.yaml diff --git a/ReadMe.md b/ReadMe.md index 07f3c36..48c2e30 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -2,4 +2,4 @@ ## Summary -## Project Structure \ No newline at end of file +## Project Structure From 91c1b3b91e8fa4cc0d87911fd83b4a44b4b8aed6 Mon Sep 17 00:00:00 2001 From: Scott Gibb Date: Sat, 18 Nov 2023 17:26:42 +0000 Subject: [PATCH 07/22] trying different shellcheck --- .github/workflows/Static Analysis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Static Analysis.yml b/.github/workflows/Static Analysis.yml index 02a4816..b5b7380 100644 --- a/.github/workflows/Static Analysis.yml +++ b/.github/workflows/Static Analysis.yml @@ -16,7 +16,8 @@ - name: Shell Check run: | echo "Checking shell scripts" - shellcheck **/**/*.sh + find . -type f -name "*.sh" -print0 | xargs -0 shellcheck + Markdown_Lint_Check: name: Markdown Lint Check From 22a2dd5972bf9d9bac9cec7a5e3daa1181bcd472 Mon Sep 17 00:00:00 2001 From: Scott Gibb Date: Sat, 18 Nov 2023 17:28:33 +0000 Subject: [PATCH 08/22] addingshell script fix --- PrusaPrint/setupOctoprint.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PrusaPrint/setupOctoprint.sh b/PrusaPrint/setupOctoprint.sh index 36db452..8cc795a 100644 --- a/PrusaPrint/setupOctoprint.sh +++ b/PrusaPrint/setupOctoprint.sh @@ -9,8 +9,10 @@ echo "Navigating to Home Directory" cd /home/pi || { echo "Failed to navigate to /home/pi. Exiting."; exit 1; } echo "Downloading LED Strip Controller Code" git clone https://github.com/ScottGibb/LED-Strip-Controller-Octoprint.git || { echo "Failed to download LED Strip Controller Code. Exiting."; exit 1; } +cd "$current_dir" || { echo "Failed to navigate back to the original directory. Exiting."; exit 1; } echo "Finished Download" + # Install Temp Sensor drivers DHT11 echo "Setting up DHT11 Drivers" pip3 install adafruit-circuitpython-dht From c7a3612ba4ef3c8a8056136952ad2f9d13bbc795 Mon Sep 17 00:00:00 2001 From: Scott Gibb Date: Sat, 18 Nov 2023 17:30:17 +0000 Subject: [PATCH 09/22] adding better markdown check --- .github/workflows/Static Analysis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/Static Analysis.yml b/.github/workflows/Static Analysis.yml index b5b7380..aecf195 100644 --- a/.github/workflows/Static Analysis.yml +++ b/.github/workflows/Static Analysis.yml @@ -18,7 +18,6 @@ echo "Checking shell scripts" find . -type f -name "*.sh" -print0 | xargs -0 shellcheck - Markdown_Lint_Check: name: Markdown Lint Check runs-on: ubuntu-latest @@ -30,7 +29,7 @@ - name: Run markdownlint run: | echo "Checking Markdown files" - markdownlint '**/**/*.md' + find . -type f -name "*.md" -print0 | xargs -0 markdownlint YAML_Lint_Check: name: YAML Lint Check From a1b0f51c20fa8b4111aefcae3ba50a34275c82d6 Mon Sep 17 00:00:00 2001 From: Scott Gibb Date: Sat, 18 Nov 2023 17:31:41 +0000 Subject: [PATCH 10/22] Adding fix as well as a deliberate bug --- PrusaPrint/ReadMe.md | 4 ++-- ReadMe.md | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/PrusaPrint/ReadMe.md b/PrusaPrint/ReadMe.md index 330d11b..12b5e8c 100644 --- a/PrusaPrint/ReadMe.md +++ b/PrusaPrint/ReadMe.md @@ -6,7 +6,7 @@ For Prusaprint, the setupOctoprint.sh should be called and the following docker - utils -## Setup Octoprint +## Setup Octoprint As for setting up Octoprint, the script setupOctoprint.sh will need to be run along the extra installs section of this ReadMe.md @@ -27,7 +27,7 @@ As for extra installs, Octodash cant be installed using the plugin manager and t bash <(wget -qO- https://github.com/UnchartedBull/OctoDash/raw/main/scripts/install.sh) ``` -## Useful Links +## Useful Links - [OctoDash](https://github.com/UnchartedBull/OctoDash/wiki/Installation) - [Camera Module V3 Autofocus Settings](https://community.octoprint.org/t/manual-raspi-camera-v3-webcam-auto-focus/53025) diff --git a/ReadMe.md b/ReadMe.md index 48c2e30..e00c278 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -1,5 +1,7 @@ # Home Lab Containers -## Summary +## Summary -## Project Structure +## Project Structure + +# throw an error \ No newline at end of file From dcc875f6dd561e985a0a259dd07de1c3b766946c Mon Sep 17 00:00:00 2001 From: Scott Gibb Date: Sat, 18 Nov 2023 17:32:21 +0000 Subject: [PATCH 11/22] removing bug --- ReadMe.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index e00c278..33aca8c 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -1,7 +1,5 @@ # Home Lab Containers -## Summary +## Summary ## Project Structure - -# throw an error \ No newline at end of file From 810695d577a5d5e5a0986ab9ce6af64277e6afc9 Mon Sep 17 00:00:00 2001 From: Scott Gibb Date: Sat, 18 Nov 2023 17:33:04 +0000 Subject: [PATCH 12/22] adding yamllint --- .github/workflows/Static Analysis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Static Analysis.yml b/.github/workflows/Static Analysis.yml index aecf195..705b0c0 100644 --- a/.github/workflows/Static Analysis.yml +++ b/.github/workflows/Static Analysis.yml @@ -42,8 +42,9 @@ - name: Run yamllint run: | echo "Checking YAML files" - yamllint -c .yamllint.yaml .github/**/**.yml - yamllint -c .yamllint.yaml **/**/**.yml + find . -type f -name "*.yml" -print0 | xargs -0 yamllint + find . -type f -name "*.yaml" -print0 | xargs -0 yamllint + Python_Lint_Check: name: Python Lint Check From f7bb90f6ed35f49edf969ee28a4ee1da9b1a47d2 Mon Sep 17 00:00:00 2001 From: Scott Gibb Date: Sat, 18 Nov 2023 17:41:33 +0000 Subject: [PATCH 13/22] updating docker-compose files --- .github/workflows/Static Analysis.yml | 7 +++---- PiHome/IOT/docker-compose.yml | 7 ++++--- PiHome/Security/docker-compose.yml | 30 +++++++++++++-------------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/Static Analysis.yml b/.github/workflows/Static Analysis.yml index 705b0c0..dabf884 100644 --- a/.github/workflows/Static Analysis.yml +++ b/.github/workflows/Static Analysis.yml @@ -1,9 +1,9 @@ --- name: Static Analysis - + on: [push] - + jobs: Shell_Check: name: Shell Check @@ -30,7 +30,7 @@ run: | echo "Checking Markdown files" find . -type f -name "*.md" -print0 | xargs -0 markdownlint - + YAML_Lint_Check: name: YAML Lint Check runs-on: ubuntu-latest @@ -45,7 +45,6 @@ find . -type f -name "*.yml" -print0 | xargs -0 yamllint find . -type f -name "*.yaml" -print0 | xargs -0 yamllint - Python_Lint_Check: name: Python Lint Check runs-on: ubuntu-latest diff --git a/PiHome/IOT/docker-compose.yml b/PiHome/IOT/docker-compose.yml index df838ec..2ae3d7d 100644 --- a/PiHome/IOT/docker-compose.yml +++ b/PiHome/IOT/docker-compose.yml @@ -1,7 +1,9 @@ +--- + version: '3.7' services: - + node-red: container_name: Node-Red image: nodered/node-red:latest @@ -56,5 +58,4 @@ services: - 60000:60000 privileged: true restart: unless-stopped - - \ No newline at end of file + \ No newline at end of file diff --git a/PiHome/Security/docker-compose.yml b/PiHome/Security/docker-compose.yml index c0a88e6..d90e102 100644 --- a/PiHome/Security/docker-compose.yml +++ b/PiHome/Security/docker-compose.yml @@ -1,18 +1,18 @@ version: "3.7" services: - motion-eye: - image: ccrisan/motioneye:master-armhf - container_name: Motion-Eye - environment: - - TZ=Europe/London - volumes: - - type: bind - source: /home/pi/motion-eye/etc - target: /etc - - type: bind - source: /home/pi/motion-eye/var - target: /var - ports: - - 8765:8765 - restart: unless-stopped + motion-eye: + image: ccrisan/motioneye:master-armhf + container_name: Motion-Eye + environment: + - TZ=Europe/London + volumes: + - type: bind + source: /home/pi/motion-eye/etc + target: /etc + - type: bind + source: /home/pi/motion-eye/var + target: /var + ports: + - 8765:8765 + restart: unless-stopped From e1a4fe46c93bfe395a343bb4bf125947883430f5 Mon Sep 17 00:00:00 2001 From: Scott Gibb Date: Sat, 18 Nov 2023 17:46:22 +0000 Subject: [PATCH 14/22] Adding Prusaprint json files --- PrusaPrint/ReadMe.md | 3 ++- PrusaPrint/plugin_list.json | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 PrusaPrint/plugin_list.json diff --git a/PrusaPrint/ReadMe.md b/PrusaPrint/ReadMe.md index 12b5e8c..00c8b4d 100644 --- a/PrusaPrint/ReadMe.md +++ b/PrusaPrint/ReadMe.md @@ -17,7 +17,7 @@ You will also need to reinstall the plugins and the Octoprint configuration. Thi - plugin_list.json - octopi-backup-xxx.zip -It is recommended you do it, by first installing the plugins then applying the backup file +It is recommended you do it, by first installing the plugins then applying the backup file, sadly the backup file cant be VC on GitHub so it can be found on the NAS. ### Extra Installs @@ -31,3 +31,4 @@ bash <(wget -qO- https://github.com/UnchartedBull/OctoDash/raw/main/scripts/inst - [OctoDash](https://github.com/UnchartedBull/OctoDash/wiki/Installation) - [Camera Module V3 Autofocus Settings](https://community.octoprint.org/t/manual-raspi-camera-v3-webcam-auto-focus/53025) +-[DH11 Not showing up on GUI](https://github.com/vitormhenrique/OctoPrint-Enclosure/issues/435) diff --git a/PrusaPrint/plugin_list.json b/PrusaPrint/plugin_list.json new file mode 100644 index 0000000..59d9a22 --- /dev/null +++ b/PrusaPrint/plugin_list.json @@ -0,0 +1 @@ +[{"key": "wifistatus", "name": "WiFi Status", "url": "https://github.com/ManuelMcLure/OctoPrint-WiFiStatus", "archive": "https://github.com/ManuelMcLure/OctoPrint-WiFiStatus/archive/main.zip"}, {"key": "prusaslicerthumbnails", "name": "Slicer Thumbnails", "url": "https://github.com/jneilliii/OctoPrint-PrusaSlicerThumbnails", "archive": "https://github.com/jneilliii/OctoPrint-PrusaSlicerThumbnails/archive/master.zip"}, {"key": "PrintJobHistory", "name": "PrintJobHistory", "url": "https://github.com/OllisGit/OctoPrint-PrintJobHistory", "archive": "https://github.com/OllisGit/OctoPrint-PrintJobHistory/releases/latest/download/master.zip"}, {"key": "preheat", "name": "Preheat Button", "url": "https://github.com/marian42/octoprint-preheat", "archive": "https://github.com/marian42/octoprint-preheat/archive/master.zip"}, {"key": "powerfailure", "name": "Power Failure Recovery", "url": "https://github.com/pablogventura/OctoPrint-PowerFailure", "archive": "https://github.com/pablogventura/OctoPrint-PowerFailure/archive/master.zip"}, {"key": "tplinksmartplug", "name": "TP-Link Smartplug", "url": "https://github.com/jneilliii/OctoPrint-TPLinkSmartplug", "archive": "https://github.com/jneilliii/OctoPrint-TPLinkSmartplug/archive/master.zip"}, {"key": "telegram", "name": "Telegram Notifications", "url": "https://github.com/fabianonline/OctoPrint-Telegram", "archive": "https://github.com/fabianonline/OctoPrint-Telegram/archive/master.zip"}, {"key": "SpoolManager", "name": "SpoolManager Plugin", "url": "https://github.com/OllisGit/OctoPrint-SpoolManager", "archive": "https://github.com/OllisGit/OctoPrint-SpoolManager/releases/latest/download/master.zip"}, {"key": "resource_monitor", "name": "Resource Monitor", "url": "https://github.com/Renaud11232/OctoPrint-Resource-Monitor", "archive": "https://github.com/Renaud11232/OctoPrint-Resource-Monitor/archive/master.zip"}, {"key": "PrintTimeGenius", "name": "PrintTimeGenius Plugin", "url": "https://github.com/eyal0/OctoPrint-PrintTimeGenius", "archive": "https://github.com/eyal0/OctoPrint-PrintTimeGenius/archive/master.zip"}, {"key": "prettygcode", "name": "PrettyGCode", "url": "https://github.com/Kragrathea/OctoPrint-PrettyGCode", "archive": "https://github.com/Kragrathea/OctoPrint-PrettyGCode/archive/master.zip"}, {"key": "plotlytempgraph", "name": "Plotly Temp Graph", "url": "https://github.com/jneilliii/OctoPrint-PlotlyTempGraph", "archive": "https://github.com/jneilliii/OctoPrint-PlotlyTempGraph/archive/master.zip"}, {"key": "multicam", "name": "MultiCam", "url": "https://github.com/mikedmor/OctoPrint_MultiCam", "archive": "https://github.com/mikedmor/OctoPrint_MultiCam/archive/master.zip"}, {"key": "mqtt", "name": "MQTT", "url": "https://github.com/OctoPrint/OctoPrint-MQTT", "archive": "https://github.com/OctoPrint/OctoPrint-MQTT/archive/master.zip"}, {"key": "homeassistant", "name": "HomeAssistant Discovery", "url": "https://github.com/cmroche/OctoPrint-HomeAssistant", "archive": "https://github.com/cmroche/OctoPrint-HomeAssistant/archive/master.zip"}, {"key": "excluderegion", "name": "Exclude Region", "url": "https://github.com/bradcfisher/OctoPrint-ExcludeRegionPlugin", "archive": "https://github.com/bradcfisher/OctoPrint-ExcludeRegionPlugin/archive/master.zip"}, {"key": "enclosure", "name": "Enclosure Plugin", "url": "https://github.com/vitormhenrique/OctoPrint-Enclosure", "archive": "https://github.com/vitormhenrique/OctoPrint-Enclosure/archive/master.zip"}, {"key": "dashboard", "name": "Dashboard", "url": "https://github.com/j7126/OctoPrint-Dashboard", "archive": "https://github.com/j7126/OctoPrint-Dashboard/archive/master.zip"}, {"key": "costestimation", "name": "Cost Estimation", "url": "https://github.com/OllisGit/OctoPrint-CostEstimation", "archive": "https://github.com/OllisGit/OctoPrint-CostEstimation/releases/latest/download/master.zip"}, {"key": "camerasettings", "name": "Camera Settings", "url": "https://github.com/The-EG/OctoPrint-CameraSettings", "archive": "https://github.com/The-EG/OctoPrint-CameraSettings/archive/main.zip"}, {"key": "octolapse", "name": "Octolapse", "url": "https://github.com/FormerLurker/Octolapse", "archive": "https://github.com/FormerLurker/Octolapse/archive/master.zip"}, {"key": "octodashcompanion", "name": "OctoDash Companion", "url": "https://github.com/jneilliii/OctoPrint-OctoDashCompanion", "archive": "https://github.com/jneilliii/OctoPrint-OctoDashCompanion/archive/master.zip"}, {"key": "octoapp", "name": "OctoApp", "url": "https://github.com/crysxd/OctoApp-Plugin/", "archive": "https://github.com/crysxd/OctoApp-Plugin/archive/refs/heads/release.zip"}, {"key": "DisplayLayerProgress", "name": "DisplayLayerProgress Plugin", "url": "https://github.com/OllisGit/OctoPrint-DisplayLayerProgress", "archive": "https://github.com/OllisGit/OctoPrint-DisplayLayerProgress/releases/latest/download/master.zip"}, {"key": "bedlevelvisualizer", "name": "Bed Visualizer", "url": "https://github.com/jneilliii/OctoPrint-BedLevelVisualizer", "archive": "https://github.com/jneilliii/OctoPrint-BedLevelVisualizer/archive/master.zip"}, {"key": "bedcheckai", "name": "Bed Check AI", "url": "https://github.com/printpal-io/OctoPrint-BedCheckAI", "archive": "https://github.com/printpal-io/OctoPrint-BedCheckAI/archive/master.zip"}, {"key": "detailedprogress", "name": "Detailed Progress", "url": "https://github.com/tpmullan/OctoPrint-DetailedProgress", "archive": "https://github.com/tpmullan/OctoPrint-DetailedProgress/archive/master.zip"}, {"key": "arc_welder", "name": "Arc-Welder", "url": "https://github.com/FormerLurker/ArcWelderPlugin", "archive": "https://github.com/FormerLurker/ArcWelderPlugin/archive/master.zip"}] \ No newline at end of file From a21804860b9bbb3e5398ee8958911e953a744a9d Mon Sep 17 00:00:00 2001 From: Scott Gibb Date: Sat, 18 Nov 2023 17:50:19 +0000 Subject: [PATCH 15/22] more formatting for yml --- .github/workflows/Static Analysis.yml | 2 +- PiHome/IOT/docker-compose.yml | 7 +++---- PiHome/Security/docker-compose.yml | 2 ++ utils/docker-compose.yml | 12 +++++++----- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/Static Analysis.yml b/.github/workflows/Static Analysis.yml index dabf884..374ea44 100644 --- a/.github/workflows/Static Analysis.yml +++ b/.github/workflows/Static Analysis.yml @@ -55,4 +55,4 @@ - name: Run Pylint run: | echo "Checking source files with pylint" - pylint --fail-under=4 **/*.py \ No newline at end of file + pylint --fail-under=4 **/*.py diff --git a/PiHome/IOT/docker-compose.yml b/PiHome/IOT/docker-compose.yml index 2ae3d7d..749139a 100644 --- a/PiHome/IOT/docker-compose.yml +++ b/PiHome/IOT/docker-compose.yml @@ -11,9 +11,9 @@ services: tty: true environment: - TZ=Europe/London -# ports: -# - 1880:1880 -# - 3456:3456 + # ports: + # - 1880:1880 + # - 3456:3456 volumes: - type: bind source: /home/pi/node-red @@ -58,4 +58,3 @@ services: - 60000:60000 privileged: true restart: unless-stopped - \ No newline at end of file diff --git a/PiHome/Security/docker-compose.yml b/PiHome/Security/docker-compose.yml index d90e102..9c8d187 100644 --- a/PiHome/Security/docker-compose.yml +++ b/PiHome/Security/docker-compose.yml @@ -1,3 +1,5 @@ +--- + version: "3.7" services: diff --git a/utils/docker-compose.yml b/utils/docker-compose.yml index 1c8363e..d5301b3 100644 --- a/utils/docker-compose.yml +++ b/utils/docker-compose.yml @@ -1,15 +1,17 @@ +--- + version: '3.7' services: - + Portainer: image: portainer/portainer-ce container_name: portainer volumes: - - type: bind - source: /var/run/docker.sock - target: /var/run/docker.sock - - portainer_data:/data + - type: bind + source: /var/run/docker.sock + target: /var/run/docker.sock + - portainer_data:/data ports: - 8000:8000 - 9443:9443 From 480b3dbbbc2b8ebf07ce93663b26dc40659b9906 Mon Sep 17 00:00:00 2001 From: Scott Gibb Date: Sat, 18 Nov 2023 17:57:13 +0000 Subject: [PATCH 16/22] finl ylm linting --- .github/workflows/Static Analysis.yml | 103 +++++++++++++------------- utils/docker-compose.yml | 2 +- 2 files changed, 52 insertions(+), 53 deletions(-) diff --git a/.github/workflows/Static Analysis.yml b/.github/workflows/Static Analysis.yml index 374ea44..44a875f 100644 --- a/.github/workflows/Static Analysis.yml +++ b/.github/workflows/Static Analysis.yml @@ -1,58 +1,57 @@ --- - name: Static Analysis +name: Static Analysis +on: [push] - on: [push] +jobs: + Shell_Check: + name: Shell Check + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Install Dependencies + run: sudo apt-get install -y shellcheck + - name: Shell Check + run: | + echo "Checking shell scripts" + find . -type f -name "*.sh" -print0 | xargs -0 shellcheck - jobs: - Shell_Check: - name: Shell Check - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Install Dependencies - run: sudo apt-get install -y shellcheck - - name: Shell Check - run: | - echo "Checking shell scripts" - find . -type f -name "*.sh" -print0 | xargs -0 shellcheck + Markdown_Lint_Check: + name: Markdown Lint Check + runs-on: ubuntu-latest + steps: + - name: Install markdownlint-cli + run: npm install -g markdownlint-cli + - name: Checkout code + uses: actions/checkout@v2 + - name: Run markdownlint + run: | + echo "Checking Markdown files" + find . -type f -name "*.md" -print0 | xargs -0 markdownlint - Markdown_Lint_Check: - name: Markdown Lint Check - runs-on: ubuntu-latest - steps: - - name: Install markdownlint-cli - run: npm install -g markdownlint-cli - - name: Checkout code - uses: actions/checkout@v2 - - name: Run markdownlint - run: | - echo "Checking Markdown files" - find . -type f -name "*.md" -print0 | xargs -0 markdownlint + YAML_Lint_Check: + name: YAML Lint Check + runs-on: ubuntu-latest + steps: + - name: Install yamllint + run: sudo apt install yamllint + - name: Checkout code + uses: actions/checkout@v2 + - name: Run yamllint + run: | + echo "Checking YAML files" + find . -type f -name "*.yml" -print0 | xargs -0 yamllint + find . -type f -name "*.yaml" -print0 | xargs -0 yamllint - YAML_Lint_Check: - name: YAML Lint Check - runs-on: ubuntu-latest - steps: - - name: Install yamllint - run: sudo apt install yamllint - - name: Checkout code - uses: actions/checkout@v2 - - name: Run yamllint - run: | - echo "Checking YAML files" - find . -type f -name "*.yml" -print0 | xargs -0 yamllint - find . -type f -name "*.yaml" -print0 | xargs -0 yamllint - - Python_Lint_Check: - name: Python Lint Check - runs-on: ubuntu-latest - steps: - - name: Install pylint - run: | - pip install pylint - - name: Run Pylint - run: | - echo "Checking source files with pylint" - pylint --fail-under=4 **/*.py + Python_Lint_Check: + name: Python Lint Check + runs-on: ubuntu-latest + steps: + - name: Install pylint + run: | + pip install pylint + - name: Run Pylint + run: | + echo "Checking source files with pylint" + pylint --fail-under=4 **/*.py diff --git a/utils/docker-compose.yml b/utils/docker-compose.yml index d5301b3..561c949 100644 --- a/utils/docker-compose.yml +++ b/utils/docker-compose.yml @@ -40,4 +40,4 @@ services: # DBUS_SYSTEM_BUS_ADDRESS: "unix:path=/host/run/dbus/system_bus_socket" volumes: - portainer_data: \ No newline at end of file + portainer_data: From 60bd5b79930976721a5b7b6f29aac59a75fddccd Mon Sep 17 00:00:00 2001 From: Scott Gibb Date: Sat, 18 Nov 2023 17:57:55 +0000 Subject: [PATCH 17/22] updating pylint --- .github/workflows/Static Analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Static Analysis.yml b/.github/workflows/Static Analysis.yml index 44a875f..e170665 100644 --- a/.github/workflows/Static Analysis.yml +++ b/.github/workflows/Static Analysis.yml @@ -54,4 +54,4 @@ jobs: - name: Run Pylint run: | echo "Checking source files with pylint" - pylint --fail-under=4 **/*.py + pylint --fail-under=4 ./ From 959699268dffdda6a6da90d383bb861f3eba9a5b Mon Sep 17 00:00:00 2001 From: Scott Gibb Date: Sat, 18 Nov 2023 18:00:05 +0000 Subject: [PATCH 18/22] updating the getDHT script --- PrusaPrint/getDHTTemp.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PrusaPrint/getDHTTemp.py b/PrusaPrint/getDHTTemp.py index eaf6134..d1e734c 100644 --- a/PrusaPrint/getDHTTemp.py +++ b/PrusaPrint/getDHTTemp.py @@ -25,7 +25,7 @@ retry_count = 0 while retry_count <= max_retries: # try: - if True: + if True: humidity=dhtDevice.humidity temperature=dhtDevice.temperature @@ -36,8 +36,8 @@ # print('-1 | -1') # sys.exit(1) - time.sleep(1) - retry_count += 1 + time.sleep(1) + retry_count += 1 print('-1 | -1') sys.exit(1) From 00de892b1202f24fca2cda97d09859bb6a11cfda Mon Sep 17 00:00:00 2001 From: Scott Gibb Date: Sat, 18 Nov 2023 18:01:49 +0000 Subject: [PATCH 19/22] updating pylint settings --- .github/workflows/Static Analysis.yml | 2 +- PrusaPrint/__init__.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 PrusaPrint/__init__.py diff --git a/.github/workflows/Static Analysis.yml b/.github/workflows/Static Analysis.yml index e170665..5844e8b 100644 --- a/.github/workflows/Static Analysis.yml +++ b/.github/workflows/Static Analysis.yml @@ -54,4 +54,4 @@ jobs: - name: Run Pylint run: | echo "Checking source files with pylint" - pylint --fail-under=4 ./ + pylint --fail-under=4 ./PrusaPrint/ diff --git a/PrusaPrint/__init__.py b/PrusaPrint/__init__.py new file mode 100644 index 0000000..585cbb4 --- /dev/null +++ b/PrusaPrint/__init__.py @@ -0,0 +1 @@ +# Required to run pylint \ No newline at end of file From a78548bed15010887be7db70604fb94640afa077 Mon Sep 17 00:00:00 2001 From: Scott Gibb Date: Sat, 18 Nov 2023 18:03:38 +0000 Subject: [PATCH 20/22] removing pylint --- .github/workflows/Static Analysis.yml | 11 ----------- PrusaPrint/__init__.py | 1 - 2 files changed, 12 deletions(-) delete mode 100644 PrusaPrint/__init__.py diff --git a/.github/workflows/Static Analysis.yml b/.github/workflows/Static Analysis.yml index 5844e8b..b8dc267 100644 --- a/.github/workflows/Static Analysis.yml +++ b/.github/workflows/Static Analysis.yml @@ -44,14 +44,3 @@ jobs: find . -type f -name "*.yml" -print0 | xargs -0 yamllint find . -type f -name "*.yaml" -print0 | xargs -0 yamllint - Python_Lint_Check: - name: Python Lint Check - runs-on: ubuntu-latest - steps: - - name: Install pylint - run: | - pip install pylint - - name: Run Pylint - run: | - echo "Checking source files with pylint" - pylint --fail-under=4 ./PrusaPrint/ diff --git a/PrusaPrint/__init__.py b/PrusaPrint/__init__.py deleted file mode 100644 index 585cbb4..0000000 --- a/PrusaPrint/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# Required to run pylint \ No newline at end of file From d4490874508adc5678593d80633f474ed67276e3 Mon Sep 17 00:00:00 2001 From: Scott Gibb Date: Sat, 18 Nov 2023 18:04:41 +0000 Subject: [PATCH 21/22] removing blank line --- .github/workflows/Static Analysis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/Static Analysis.yml b/.github/workflows/Static Analysis.yml index b8dc267..66d7d85 100644 --- a/.github/workflows/Static Analysis.yml +++ b/.github/workflows/Static Analysis.yml @@ -43,4 +43,3 @@ jobs: echo "Checking YAML files" find . -type f -name "*.yml" -print0 | xargs -0 yamllint find . -type f -name "*.yaml" -print0 | xargs -0 yamllint - From 17139cdf01a23fa49ea13d935ab8264c84a98641 Mon Sep 17 00:00:00 2001 From: Scott Gibb Date: Sat, 18 Nov 2023 18:05:41 +0000 Subject: [PATCH 22/22] fixing formatting again --- .yamllint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.yamllint.yaml b/.yamllint.yaml index eed2490..5972b9e 100644 --- a/.yamllint.yaml +++ b/.yamllint.yaml @@ -32,4 +32,4 @@ rules: quoted-strings: disable trailing-spaces: enable truthy: - level: warning \ No newline at end of file + level: warning