<template>
  <Device v-if="id" :deviceId="id"></Device>
</template>
<script>
import Device from "../Device.vue";

export default {
  asyncComputed: {
    id: {
      async get() {
        const device = this.$store.state.scrypted.devices
          .map((id) => this.$scrypted.systemManager.getDeviceById(id))
          .find((device) => {
            return device.pluginId === "@scrypted/core" && device.nativeId === "automationcore";
          });

        return device?.id;
      }
    }
  },
  components: { Device }
};
</script>