×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

CUSTOM TRACKING

  • Posts: 10
  • Thank you received: 0

CUSTOM TRACKING was created by Federica

Hello,
I was implementing the custom tracking on my python code.

I saw from the standard properties that TELESCOPE_TRACK_RATE is a Switch, therefore I wrote
trackrate = telescope.getSwitch("TELESCOPE_TRACK_RATE")

and then
trackrate[0].s = PyIndi.ISS_OFF
trackrate[1].s = PyIndi.ISS_OFF
trackrate[2].s = PyIndi.ISS_OFF
trackrate[3].s = PyIndi.ISS_ON

but it returns

trackrate.s[0] = PyIndi.ISS_OFF
TypeError: 'NoneType' object is not subscriptable.

What am I doing wrong?
3 years 10 months ago #54588

Please Log in or Create an account to join the conversation.

  • Posts: 983
  • Thank you received: 375

Replied by Radek Kaczorek on topic CUSTOM TRACKING

Switch is a property of a device. You need to list properties in a device and then access switch in properties. Now you are trying to access switch in a device directly (telescope).
See example code here: pypi.org/project/pyindi-client/0.1.0a1/
3 years 10 months ago #54590

Please Log in or Create an account to join the conversation.

  • Posts: 10
  • Thank you received: 0

Replied by Federica on topic CUSTOM TRACKING


I didn't get how to do it; in any case, the switch previously worked with the ON_COORD_SET...
3 years 10 months ago #54595

Please Log in or Create an account to join the conversation.

  • Posts: 10
  • Thank you received: 0

Replied by Federica on topic CUSTOM TRACKING

(telescope is already initializated with indiclient)
3 years 10 months ago #54596

Please Log in or Create an account to join the conversation.

  • Posts: 1
  • Thank you received: 0

Replied by irvinborder on topic CUSTOM TRACKING

This error means that you attempted to index an object that doesn’t have that functionality. You might have noticed that the method sort() that only modify the list have no return value printed – they return the default NoneNone . ‘NoneType’ object is not subscriptable is the one thrown by python when you use the square bracket notation object[key] where an object doesn’t define the getitem method . This is a design principle for all mutable data structures in Python. You can reproduce TypeError that you get in your code if you try this at the Python command line:
None[0]

None has a special status in Python. It is a favourite baseline value because many algorithms treat it as an exceptional value, used in many places in the language and library to represent the absence of some other value .
3 years 7 months ago #57813

Please Log in or Create an account to join the conversation.

Time to create page: 0.976 seconds