github.com/e154/smart-home@v0.17.2-0.20240311175135-e530a6e5cd45/plugins/logs/types.go (about) 1 // This file is part of the Smart Home 2 // Program complex distribution https://github.com/e154/smart-home 3 // Copyright (C) 2016-2023, Filippov Alex 4 // 5 // This library is free software: you can redistribute it and/or 6 // modify it under the terms of the GNU Lesser General Public 7 // License as published by the Free Software Foundation; either 8 // version 3 of the License, or (at your option) any later version. 9 // 10 // This library is distributed in the hope that it will be useful, 11 // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 // Library General Public License for more details. 14 // 15 // You should have received a copy of the GNU Lesser General Public 16 // License along with this library. If not, see 17 // <https://www.gnu.org/licenses/>. 18 19 package logs 20 21 import ( 22 "github.com/e154/smart-home/common" 23 m "github.com/e154/smart-home/models" 24 ) 25 26 const ( 27 // EntityLogs ... 28 EntityLogs = string("logs") 29 30 AttrErrTotal = "err_total" 31 AttrErrToday = "err_today" 32 AttrErrYesterday = "err_yesterday" 33 AttrWarnTotal = "warn_total" 34 AttrWarnToday = "warn_today" 35 AttrWarnYesterday = "warn_yesterday" 36 37 // Name ... 38 Name = "logs" 39 40 // EntityType ... 41 EntityType = "logs" 42 43 Version = "0.0.1" 44 ) 45 46 // NewAttr ... 47 func NewAttr() m.Attributes { 48 return m.Attributes{ 49 AttrErrTotal: { 50 Name: AttrErrTotal, 51 Type: common.AttributeInt, 52 }, 53 AttrErrToday: { 54 Name: AttrErrToday, 55 Type: common.AttributeInt, 56 }, 57 AttrErrYesterday: { 58 Name: AttrErrYesterday, 59 Type: common.AttributeInt, 60 }, 61 AttrWarnTotal: { 62 Name: AttrWarnTotal, 63 Type: common.AttributeInt, 64 }, 65 AttrWarnToday: { 66 Name: AttrWarnToday, 67 Type: common.AttributeInt, 68 }, 69 AttrWarnYesterday: { 70 Name: AttrWarnYesterday, 71 Type: common.AttributeInt, 72 }, 73 } 74 }