def __init__(self, json_obj, vera_controller):
self.json_state = json_obj<EOL>self.device_id = self.json_state.get('<STR_LIT:id>')<EOL>self.vera_controller = vera_controller<EOL>self.name = '<STR_LIT>'<EOL>if self.json_state.get('<STR_LIT>'):<EOL><INDENT>self.category = self.json_state.get('<STR_LIT>').get('<STR_LIT>')<EOL>self.category_name = (<EOL>self.json_state.get('<STR_LIT>').get('<STR_LIT>'))<EOL>self.name = self.json_state.get('<STR_LIT>').get('<STR_LIT:name>')<EOL><DEDENT>else:<EOL><INDENT>self.category_name = '<STR_LIT>'<EOL><DEDENT>if not self.name:<EOL><INDENT>if self.category_name:<EOL><INDENT>self.name = ('<STR_LIT>' + self.category_name +<EOL>'<STR_LIT:U+0020>' + str(self.device_id))<EOL><DEDENT>else:<EOL><INDENT>self.name = '<STR_LIT>' + str(self.device_id)<EOL><DEDENT><DEDENT>
Setup a Vera device.