1
2
3
4
5
6
7
8
9
10
11 __doc__="""PowerSupply
12
13 PowerSupply is an abstraction of a power supply on a device.
14
15 $Id: PowerSupply.py,v 1.7 2004/04/06 22:33:24 edahl Exp $"""
16
17 __version__ = "$Revision: 1.7 $"[11:-2]
18
19 from Globals import InitializeClass
20
21 from Products.ZenRelations.RelSchema import *
22
23 from HWComponent import HWComponent
24
25 from Products.ZenModel.ZenossSecurity import *
26
28 """PowerSupply object"""
29
30 portal_type = meta_type = 'PowerSupply'
31
32 watts = None
33 type = "unknown"
34 state = "unknown"
35
36 _properties = HWComponent._properties + (
37 {'id':'watts', 'type':'int', 'mode':'w'},
38 {'id':'type', 'type':'string', 'mode':'w'},
39 {'id':'state', 'type':'string', 'mode':'w'},
40 )
41
42 _relations = HWComponent._relations + (
43 ("hw", ToOne(ToManyCont, "Products.ZenModel.DeviceHW",
44 "powersupplies")),
45 )
46
47
48 factory_type_information = (
49 {
50 'id' : 'PowerSupply',
51 'meta_type' : 'PowerSupply',
52 'description' : """Arbitrary device grouping class""",
53 'icon' : 'PowerSupply_icon.gif',
54 'product' : 'ZenModel',
55 'factory' : 'manage_addPowerSupply',
56 'immediate_view' : 'viewPowerSupply',
57 'actions' :
58 (
59 { 'id' : 'status'
60 , 'name' : 'Status'
61 , 'action' : 'viewPowerSupply'
62 , 'permissions' : ('View',)
63 },
64 { 'id' : 'perfConf'
65 , 'name' : 'Template'
66 , 'action' : 'objTemplates'
67 , 'permissions' : ("Change Device", )
68 },
69 )
70 },
71 )
72
73
75 """
76 Return a string representation of the watts
77 """
78 return self.watts is None and "unknown" or str(self.watts)
79
80
89
90
97
98
101 name = viewName
102
103
104 InitializeClass(PowerSupply)
105