Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
python-mqtt-gpio
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Alexander Wellbrock
python-mqtt-gpio
Commits
0dc3e4ff
Commit
0dc3e4ff
authored
6 years ago
by
Ellis Percival
Browse files
Options
Downloads
Patches
Plain Diff
Add schema to repo for now
parent
45727a49
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pi_mqtt_gpio/__init__.py
+163
-4
163 additions, 4 deletions
pi_mqtt_gpio/__init__.py
with
163 additions
and
4 deletions
pi_mqtt_gpio/__init__.py
+
163
−
4
View file @
0dc3e4ff
import
sys
print
(
"
FATAL ERROR: The file at pi_mqtt_gpio/__init__.py should be replaced us
"
"
ing
'
make schema
'
before packaging.
"
)
sys
.
exit
(
1
)
import
yaml
CONFIG_SCHEMA
=
yaml
.
load
(
"""
mqtt:
type: dict
required: yes
schema:
host:
type: string
empty: no
required: no
default: localhost
port:
type: integer
min: 1
max: 65535
required: no
default: 1883
user:
type: string
required: no
default:
""
password:
type: string
required: no
default:
""
client_id:
type: string
required: no
default:
""
topic_prefix:
type: string
required: no
default:
""
coerce: rstrip_slash
protocol:
type: string
required: no
empty: no
coerce: tostring
default:
"
3.1.1
"
allowed:
-
"
3.1
"
-
"
3.1.1
"
status_topic:
type: string
required: no
default: status
status_payload_running:
type: string
required: no
default: running
status_payload_stopped:
type: string
required: no
default: stopped
status_payload_dead:
type: string
required: no
default: dead
gpio_modules:
type: list
required: yes
schema:
type: dict
allow_unknown: yes
schema:
name:
type: string
required: yes
empty: no
module:
type: string
required: yes
empty: no
cleanup:
type: boolean
required: no
default: yes
digital_inputs:
type: list
required: no
default: []
schema:
type: dict
schema:
name:
type: string
required: yes
empty: no
module:
type: string
required: yes
empty: no
pin:
type: integer
required: yes
min: 0
on_payload:
type: string
required: yes
empty: no
off_payload:
type: string
required: yes
empty: no
pullup:
type: boolean
required: no
default: no
pulldown:
type: boolean
required: no
default: no
retain:
type: boolean
required: no
default: no
digital_outputs:
type: list
required: no
default: []
schema:
type: dict
schema:
name:
type: string
required: yes
module:
type: string
required: yes
pin:
type: integer
required: yes
min: 0
on_payload:
type: string
required: no
empty: no
off_payload:
type: string
required: no
empty: no
inverted:
type: boolean
required: no
default: no
initial:
type: string
required: no
allowed:
- high
- low
retain:
type: boolean
required: no
default: no
"""
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment