@@ -316,16 +316,16 @@ def getDeviceProperties(self, device):
316316
317317 # if p.getType() == PyIndi.INDI_TEXT:
318318 # for t in p.getText():
319- # properties[name][t.name ] = t.text
319+ # properties[name][t.getName() ] = t.getText()
320320 # elif p.getType() == PyIndi.INDI_NUMBER:
321321 # for t in p.getNumber():
322- # properties[name][t.name ] = t.value
322+ # properties[name][t.getName() ] = t.getValue()
323323 # elif p.getType() == PyIndi.INDI_SWITCH:
324324 # for t in p.getSwitch():
325- # properties[name][t.name ] = self.__state_to_str_s[t.s ]
325+ # properties[name][t.getName() ] = self.__state_to_str_s[t.getState() ]
326326 # elif p.getType() == PyIndi.INDI_LIGHT:
327327 # for t in p.getLight():
328- # properties[name][t.name ] = self.__state_to_str_p[t.s ]
328+ # properties[name][t.getName() ] = self.__state_to_str_p[t.getState() ]
329329 # elif p.getType() == PyIndi.INDI_BLOB:
330330 # pass
331331 # #for t in p.getBLOB():
@@ -729,7 +729,7 @@ def set_number(self, device, name, values, sync=True, timeout=None):
729729 #logger.info('Name: %s, values: %s', name, str(values))
730730 c = self .get_control (device , name , 'number' )
731731 for control_name , index in self .__map_indexes (c , values .keys ()).items ():
732- c [index ].value = values [control_name ]
732+ c [index ].setValue ( values [control_name ])
733733
734734 self .sendNewNumber (c )
735735
@@ -745,15 +745,15 @@ def set_switch(self, device, name, on_switches=[], off_switches=[], sync=True, t
745745 is_exclusive = c .getRule () == PyIndi .ISR_ATMOST1 or c .getRule () == PyIndi .ISR_1OFMANY
746746 if is_exclusive :
747747 on_switches = on_switches [0 :1 ]
748- off_switches = [s .name for s in c if s .name not in on_switches ]
748+ off_switches = [s .getName () for s in c if s .getName () not in on_switches ]
749749
750750 for index in range (0 , len (c )):
751751 current_state = c [index ].getState ()
752752 new_state = current_state
753753
754- if c [index ].name in on_switches :
754+ if c [index ].getName () in on_switches :
755755 new_state = PyIndi .ISS_ON
756- elif is_exclusive or c [index ].name in off_switches :
756+ elif is_exclusive or c [index ].getName () in off_switches :
757757 new_state = PyIndi .ISS_OFF
758758
759759 c [index ].setState (new_state )
@@ -766,7 +766,7 @@ def set_switch(self, device, name, on_switches=[], off_switches=[], sync=True, t
766766 def set_text (self , device , control_name , values , sync = True , timeout = None ):
767767 c = self .get_control (device , control_name , 'text' )
768768 for control_name , index in self .__map_indexes (c , values .keys ()).items ():
769- c [index ].text = values [control_name ]
769+ c [index ].setText ( values [control_name ])
770770
771771 self .sendNewText (c )
772772
@@ -777,19 +777,19 @@ def set_text(self, device, control_name, values, sync=True, timeout=None):
777777
778778
779779 def values (self , device , ctl_name , ctl_type ):
780- return dict (map (lambda c : (c .name , c .value ), self .get_control (device , ctl_name , ctl_type )))
780+ return dict (map (lambda c : (c .getName () , c .getValue () ), self .get_control (device , ctl_name , ctl_type )))
781781
782782
783783 def switch_values (self , device , name , ctl = None ):
784784 return self .__control2dict (device , name , 'switch' , lambda c : {'value' : c .getState () == PyIndi .ISS_ON }, ctl )
785785
786786
787787 def text_values (self , device , name , ctl = None ):
788- return self .__control2dict (device , name , 'text' , lambda c : {'value' : c .text }, ctl )
788+ return self .__control2dict (device , name , 'text' , lambda c : {'value' : c .getText () }, ctl )
789789
790790
791791 def number_values (self , device , name , ctl = None ):
792- return self .__control2dict (device , name , 'text' , lambda c : {'value' : c .value , 'min' : c .min , 'max' : c .max , 'step' : c .step , 'format' : c .format }, ctl )
792+ return self .__control2dict (device , name , 'text' , lambda c : {'value' : c .getValue () , 'min' : c .min , 'max' : c .max , 'step' : c .step , 'format' : c .format }, ctl )
793793
794794
795795 def light_values (self , device , name , ctl = None ):
@@ -830,15 +830,15 @@ def __wait_for_ctl_statuses(self, ctl, statuses=[PyIndi.IPS_OK, PyIndi.IPS_IDLE]
830830 def __map_indexes (self , ctl , values ):
831831 result = {}
832832 for i , c in enumerate (ctl ):
833- #logger.info('Value name: %s', c.name ) # useful to find value names
834- if c .name in values :
835- result [c .name ] = i
833+ #logger.info('Value name: %s', c.getName() ) # useful to find value names
834+ if c .getName () in values :
835+ result [c .getName () ] = i
836836 return result
837837
838838
839839 def __control2dict (self , device , control_name , control_type , transform , control = None ):
840840 def get_dict (element ):
841- dest = {'name' : element .name , 'label' : element .label }
841+ dest = {'name' : element .getName () , 'label' : element .getLabel () }
842842 dest .update (transform (element ))
843843 return dest
844844
0 commit comments