Exemple #1
0
 def _discover_children(self, force=0):
     if force:
         self._been_discovered = 0
     if self.running == 1 and not self._been_discovered:
         # do a find_all irrespective of whether there are ny devices found previously (CSCtl81599)
         self.devices, self.device_addresses = self.findall()
         # get a list of addresses in existing children
         existing = self.children_nodes(auto_discover=0)
         existing = filter(lambda dev : hasattr(dev,'address'), existing)
         existing = [dev.address for dev in existing]
         for addr in self.device_addresses:
             if addr not in existing and not self._nascent_children.get(address_to_asciihex(addr), None):
                 if ord(addr[0]) in (0x28,0x10): # need to add new types
                     # add a new instance to the _nascent children
                     
                     t = Temperature()
                     t.address = addr
                     t.model = _models[family_name[ord(addr[0])]]
                     self._nascent_children[address_to_asciihex(addr)] = t
         # self._been_discovered = 1 #disabled to allow new objects to be discovered
     return self._nascent_children
Exemple #2
0
 def _discover_children(self, force=0):
     if force:
         self._been_discovered = 0
     if self.running == 1 and not self._been_discovered:
         if not self.device_addresses:
             self.devices, self.device_addresses = self.findall()
         # get a list of addresses in existing children
         existing = self.children_nodes(auto_discover=0)
         # filter out any non-dallas nodes, like calculators or periodic drivers
         existing = filter(lambda dev : hasattr(dev,'address'), existing)
         existing = [dev.address for dev in existing]
         for addr in self.device_addresses:
             if addr not in existing and not self._nascent_children.get(address_to_asciihex(addr), None):
                 # look for temperature sensors
                 if ord(addr[0]) in (0x28,0x10): # need to add new types
                     # add a new instance to the _nascent children
                     t = Temperature()
                     t.address = addr
                     t.model = _models[family_name[ord(addr[0])]]
                     self._nascent_children[address_to_asciihex(addr)] = t
         # self._been_discovered = 1 #disabled to allow new objects to be discovered
     return self._nascent_children
Exemple #3
0
    def _discover_children(self, force=0):
        if force:
            self._been_discovered = 0
        if self.running == 1 and not self._been_discovered:
            # do a find_all irrespective of whether there are ny devices found previously (CSCtl81599)
            self.devices, self.device_addresses = self.findall()
            # get a list of addresses in existing children
            existing = self.children_nodes(auto_discover=0)
            existing = filter(lambda dev: hasattr(dev, 'address'), existing)
            existing = [dev.address for dev in existing]
            for addr in self.device_addresses:
                if addr not in existing and not self._nascent_children.get(
                        address_to_asciihex(addr), None):
                    if ord(addr[0]) in (0x28, 0x10):  # need to add new types
                        # add a new instance to the _nascent children

                        t = Temperature()
                        t.address = addr
                        t.model = _models[family_name[ord(addr[0])]]
                        self._nascent_children[address_to_asciihex(addr)] = t
            # self._been_discovered = 1 #disabled to allow new objects to be discovered
        return self._nascent_children
Exemple #4
0
 def _discover_children(self, force=0):
     if force:
         self._been_discovered = 0
     if self.running == 1 and not self._been_discovered:
         if not self.device_addresses:
             self.devices, self.device_addresses = self.findall()
         # get a list of addresses in existing children
         existing = self.children_nodes(auto_discover=0)
         # filter out any non-dallas nodes, like calculators or periodic drivers
         existing = filter(lambda dev: hasattr(dev, 'address'), existing)
         existing = [dev.address for dev in existing]
         for addr in self.device_addresses:
             if addr not in existing and not self._nascent_children.get(
                     address_to_asciihex(addr), None):
                 # look for temperature sensors
                 if ord(addr[0]) in (0x28, 0x10):  # need to add new types
                     # add a new instance to the _nascent children
                     t = Temperature()
                     t.address = addr
                     t.model = _models[family_name[ord(addr[0])]]
                     self._nascent_children[address_to_asciihex(addr)] = t
         # self._been_discovered = 1 #disabled to allow new objects to be discovered
     return self._nascent_children