-
-
Notifications
You must be signed in to change notification settings - Fork 288
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add scene trigger : New MQTT message (#1913)
- Loading branch information
Showing
18 changed files
with
329 additions
and
11 deletions.
There are no files selected for viewing
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
56 changes: 56 additions & 0 deletions
56
front/src/routes/scene/edit-scene/triggers/MQTTReceivedTrigger.jsx
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,56 @@ | ||
import { Component } from 'preact'; | ||
import { connect } from 'unistore/preact'; | ||
import { Text, Localizer } from 'preact-i18n'; | ||
|
||
class MQTTReceived extends Component { | ||
updateTopicName = e => { | ||
this.props.updateTriggerProperty(this.props.index, 'topic', e.target.value); | ||
}; | ||
|
||
updateMessage = e => { | ||
this.props.updateTriggerProperty(this.props.index, 'message', e.target.value); | ||
}; | ||
|
||
render({}, {}) { | ||
return ( | ||
<div> | ||
<p> | ||
<Text id="editScene.triggersCard.mqttReceived.description" /> | ||
</p> | ||
<div class="form-group"> | ||
<label className="form-label"> | ||
<Text id="editScene.triggersCard.mqttReceived.topicLabel" /> | ||
</label> | ||
<Localizer> | ||
<input | ||
type="text" | ||
value={this.props.trigger.topic} | ||
onInput={this.updateTopicName} | ||
className="form-control" | ||
placeholder={<Text id="editScene.triggersCard.mqttReceived.topicPlaceholder" />} | ||
/> | ||
</Localizer> | ||
</div> | ||
<div class="form-group"> | ||
<label className="form-label"> | ||
<Text id="editScene.triggersCard.mqttReceived.messageLabel" /> | ||
</label> | ||
<div class="mb-1 small"> | ||
<Text id="editScene.triggersCard.mqttReceived.messageDescription" /> | ||
</div> | ||
<Localizer> | ||
<input | ||
type="text" | ||
value={this.props.trigger.message} | ||
onInput={this.updateMessage} | ||
className="form-control" | ||
placeholder={<Text id="editScene.triggersCard.mqttReceived.messagePlaceholder" />} | ||
/> | ||
</Localizer> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default connect('httpClient,user', {})(MQTTReceived); |
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 |
---|---|---|
|
@@ -96,6 +96,7 @@ function Gladys(params = {}) { | |
gateway, | ||
scheduler, | ||
brain, | ||
service, | ||
); | ||
|
||
const gladys = { | ||
|
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -9,7 +9,8 @@ | |
"cpu": [ | ||
"x64", | ||
"arm", | ||
"arm64" | ||
"arm64", | ||
"arm64e" | ||
], | ||
"scripts": {}, | ||
"dependencies": { | ||
|
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.