<template>
  <div class="l-grid--info medium">
    <sensor
      type="temperature"
      title="温度"
      color="#ff0000"
    />
    <sensor
      type="smoke"
      title="烟雾"
      color="#8400ff"
    />
    <sensor
      type="flooding"
      title="水浸"
    />
    <sensor
      type="light"
      title="光照"
      color="#ffa200"
    />
  </div>
</template>

<script>
import {
  startSensor,
  stopSensor
} from '../../../monitor'
import Sensor from './Sensor'

export default {
  name: 'Sensors',
  components: {
    Sensor
  },
  props: {
    device: {
      type: Object,
      required: true
    }
  },
  created () {
    startSensor()
  },
  beforeDestroy () {
    stopSensor()
  }
}
</script>
