blob: ed7c5ff3f1552d697abe51669054bfddca0a2149 [file] [log] [blame]
Vitaly Buka87eb7882015-10-27 22:23:49 -07001// Copyright 2015 The Weave Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "src/privet/device_ui_kind.h"
6
7#include <base/logging.h>
8
9namespace weave {
10namespace privet {
11
12std::string GetDeviceUiKind(const std::string& manifest_id) {
13 CHECK_EQ(5u, manifest_id.size());
14 std::string kind = manifest_id.substr(0, 2);
15 if (kind == "AC")
16 return "accessPoint";
17 if (kind == "AK")
18 return "aggregator";
19 if (kind == "AM")
20 return "camera";
21 if (kind == "AB")
22 return "developmentBoard";
Paul Westbrook149ae6f2015-11-13 11:59:30 -080023 if (kind == "AH")
24 return "acHeating";
25 if (kind == "AI")
26 return "light";
27 if (kind == "AO")
28 return "lock";
Vitaly Buka87eb7882015-10-27 22:23:49 -070029 if (kind == "AE")
30 return "printer";
31 if (kind == "AF")
32 return "scanner";
33 if (kind == "AD")
34 return "speaker";
35 if (kind == "AL")
36 return "storage";
37 if (kind == "AJ")
38 return "toy";
39 if (kind == "AA")
40 return "vendor";
41 if (kind == "AN")
42 return "video";
43 LOG(FATAL) << "Invalid model id: " << manifest_id;
44 return std::string();
45}
46
47} // namespace privet
48} // namespace weave