Base class for JSON Nyx objects.
More...
|
| | __init__ (self, int ptr) |
| | Wraps a C JSON object pointer.
|
| typing.Callable | on (self, typing.Callable callback) |
| | Registers a callback triggered when clients modify this object.
|
| bool | notify (self) |
| | Notifies this Nyx / INDI object to the clients.
|
| str | to_string (self, bool json_string=True) |
| | Returns a string representing this JSON object.
|
| NyxXMLDoc | to_xmldoc (self) |
| | Converts this JSON Nyx / INDI command to the XML one.
|
Base class for JSON Nyx objects.
Definition at line 44 of file obj.py.
◆ __init__()
| nyx.obj.NyxObject.__init__ |
( |
| self, |
|
|
int | ptr ) |
Wraps a C JSON object pointer.
- Parameters
-
Definition at line 51 of file obj.py.
◆ on()
| typing.Callable nyx.obj.NyxObject.on |
( |
| self, |
|
|
typing.Callable | callback ) |
Registers a callback triggered when clients modify this object.
- Parameters
-
| callback | Callback triggered when clients modify this object. |
- Returns
- The registered callback.
@prop.on
def on_changed(new_value, old_value):
...
@vector.on
def on_changed(modified):
...
Definition at line 161 of file obj.py.
◆ notify()
| bool nyx.obj.NyxObject.notify |
( |
| self | ) |
|
Notifies this Nyx / INDI object to the clients.
- Returns
True if the object was notified, False otherwise.
Definition at line 215 of file obj.py.
◆ from_string()
| NyxObject nyx.obj.NyxObject.from_string |
( |
str | string | ) |
|
|
static |
Parses a JSON object from a string.
- Parameters
-
- Returns
- The new JSON object.
Definition at line 227 of file obj.py.
◆ to_string()
| str nyx.obj.NyxObject.to_string |
( |
| self, |
|
|
bool | json_string = True ) |
Returns a string representing this JSON object.
- Parameters
-
| json_string | If True, the resulting string is escaped. |
- Returns
- A string that represents this JSON document.
Definition at line 239 of file obj.py.
◆ to_xmldoc()
| NyxXMLDoc nyx.obj.NyxObject.to_xmldoc |
( |
| self | ) |
|
Converts this JSON Nyx / INDI command to the XML one.
- Returns
- The corresponding XML Nyx / INDI command.
Definition at line 255 of file obj.py.
The documentation for this class was generated from the following file: