[docs]defget_context_data(self,**kwargs:Any)->dict[str,Any]:"""Adds the page category and page_name for the device pages. Args: kwargs: The keyword arguments are passed to super().get_context_data() if it exists. Otherwise, kwargs is returned with the added page_category. Returns: The context data including the page_category information. """super_get_context=getattr(super(),'get_context_data',None)context=cast('dict[str, Any]',super_get_context(**kwargs))ifcallable(super_get_context)elsekwargsifself.page_categoryisnotNone:context['page_category']=self.page_categoryifself.page_nameisnotNone:context['page_name']=self.page_name# make these constants avaialable on all views, so that they can be used in the templates.context['DEVICES_PAGE_CATEGORY']=DEVICES_PAGE_CATEGORYcontext['DEVICES_PAGE_DEVICES_SUBCATEGORY']=DEVICES_PAGE_DEVICES_SUBCATEGORYcontext['DEVICES_PAGE_OPC_UA_SUBCATEGORY']=DEVICES_PAGE_OPC_UA_SUBCATEGORYreturncontext