Skip to content
This repository has been archived by the owner on Jun 14, 2020. It is now read-only.

Commit

Permalink
Merge pull request #169 from AllanYangZhou/develop
Browse files Browse the repository at this point in the history
Fix generic peripheral
  • Loading branch information
Allan Zhou committed Feb 25, 2016
2 parents 1535a3a + 2b73c68 commit a38df13
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
15 changes: 14 additions & 1 deletion dawn/js/components/peripherals/GenericPeripheral.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* A generic peripheral, used when the peripheralType is unknown.
*/
import React from 'react';
import NameEdit from './NameEdit';

export default React.createClass({
getDefaultProps() {
Expand All @@ -10,6 +11,18 @@ export default React.createClass({
};
},
render() {
return <h4> Peripheral Type Unknown <small>{this.props.peripheralType}</small></h4>;
return (
<div style={{overflow: 'auto'}}>
<div style={{overflow: 'auto', width: '100%'}}>
<h4 style={{float: 'left'}}>
<NameEdit name={this.props.name} id={this.props.id} />
<small>{this.props.peripheralType}</small>
</h4>
<h4 style={{float: 'right'}}>
{ this.props.value }
</h4>
</div>
</div>
);
}
});
4 changes: 2 additions & 2 deletions runtime/fake_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ def log_output(stream):
'peripheral': {
'name':id_to_name['1234'],
'peripheralType': 'MOTOR_SCALAR',
'value': random.randint(0, 100),
'value': random.randint(-100, 100),
'id': '1234'
}
})
ansible.send_message('UPDATE_PERIPHERAL', {
'peripheral': {
'name': id_to_name['1235'],
'peripheralType': 'SENSOR_BOOLEAN',
'peripheralType': 'LimitSwitch',
'value': random.randint(0, 1),
'id': '1235'
}
Expand Down

0 comments on commit a38df13

Please sign in to comment.