Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FPGA Device Manager 2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FPGA
FPGA Device Manager 2
Merge requests
!1
WIP: Resolve "YAML Generation"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
WIP: Resolve "YAML Generation"
1-yaml-generation
into
master
Overview
0
Commits
4
Pipelines
0
Changes
1
Open
Julian
requested to merge
1-yaml-generation
into
master
4 years ago
Overview
0
Commits
4
Pipelines
0
Changes
1
Expand
Closes
#1
0
0
Merge request reports
Viewing commit
21b984d5
Prev
Next
Show latest version
1 file
+
25
−
8
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
21b984d5
Update Hass classes
· 21b984d5
Julian
authored
4 years ago
fpga_device_manager/hass.py
+
25
−
8
Options
class
Trigger
:
p
ass
from
typing
import
Iterable
,
Dict
from
dataclasses
import
datacl
ass
@dataclass
class
Action
:
pass
service
:
str
entity_id
:
str
class
Condition
:
pass
@dataclass
class
Automation
:
alias
:
str
triggers
:
Iterable
[
Dict
]
actions
:
Iterable
[
Action
]
conditions
:
Iterable
[
Dict
]
=
None
description
:
str
=
""
@property
def
dict
(
self
):
dict_
=
{
"
alias
"
:
self
.
alias
,
"
triggers
"
:
self
.
triggers
,
"
actions
"
:
[
action
.
__dict__
for
action
in
self
.
actions
]
}
class
Automation
:
def
__init__
(
self
):
pass
if
self
.
conditions
:
dict_
[
"
conditions
"
]
=
self
.
conditions
if
self
.
description
:
dict_
[
"
description
"
]
=
self
.
description
return
dict_
Loading