Skip to content

Commit

Permalink
Merge pull request #86 from AllenShintani/master
Browse files Browse the repository at this point in the history
edit some devices of "triggered"
  • Loading branch information
AllenShintani authored Apr 15, 2024
2 parents e9c7d8b + c566a6b commit d2ed3f6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/declarative/components/input/PIRMotionSensor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ export const PIRMotionSensor: React.FC<PIRMotionSensorProps> = ({
const setupPIRMotionSensor = async (port: SerialPort) => {
const pirMotionSensor = attachInput(port, pin)

if (triggered) {
pirMotionSensor.read('off', triggered)
if (untriggered) {
pirMotionSensor.read('off', untriggered)
}

if (untriggered) {
pirMotionSensor.read('on', untriggered)
if (triggered) {
pirMotionSensor.read('on', triggered)
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/declarative/components/input/PhotoInterrupter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ export const PhotoInterrupter: React.FC<PhotoInterrupterProps> = ({
const setupPhotoInterrupter = (port: SerialPort) => {
const photointerrupter = attachInput(port, pin)

if (triggered) {
photointerrupter.read('off', triggered)
if (untriggered) {
photointerrupter.read('off', untriggered)
}

if (untriggered) {
photointerrupter.read('on', untriggered)
if (triggered) {
photointerrupter.read('on', triggered)
}
}

Expand Down

0 comments on commit d2ed3f6

Please sign in to comment.