def get_javascript_doc(self):
        doc  = common.make_rst_header(self)
        doc += common.make_rst_summary(self)
        doc += self.get_javascript_examples()
        doc += self.get_javascript_api()

        return doc
Beispiel #2
0
    def get_php_doc(self):
        doc = common.make_rst_header(self)
        doc += common.make_rst_summary(self)
        doc += self.get_php_examples()
        doc += self.get_php_api()

        return doc
Beispiel #3
0
    def get_tcpip_doc(self):
        doc = common.make_rst_header(self,
                                     has_device_identifier_constant=False)
        doc += common.make_rst_summary(self, is_programming_language=False)
        doc += self.get_tcpip_api()

        return doc
Beispiel #4
0
    def get_mathematica_doc(self):
        doc = common.make_rst_header(self)
        doc += common.make_rst_summary(self)
        doc += self.get_mathematica_examples()
        doc += self.get_mathematica_api()

        return doc
    def get_mqtt_doc(self):
        doc  = common.make_rst_header(self, False)
        doc += common.make_rst_summary(self)
        doc += self.get_mqtt_examples()
        doc += self.get_mqtt_api()

        return doc
Beispiel #6
0
    def get_tvpl_doc(self):
        doc = common.make_rst_header(self,
                                     has_device_identifier_constant=False)
        doc += common.make_rst_summary(self)
        doc += self.get_tvpl_examples()
        doc += self.get_tvpl_api()

        return doc
    def get_rust_doc(self):
        docs_rs = {'en': 'Additional documentation can be found on `docs.rs <https://docs.rs/tinkerforge/latest/tinkerforge/{module_name}/index.html>`_.\n',
                   'de': 'Zusätzliche Dokumentation findet sich auf `docs.rs <https://docs.rs/tinkerforge/latest/tinkerforge/{module_name}/index.html>`_.\n'}

        doc  = common.make_rst_header(self)
        doc += common.make_rst_summary(self)
        doc += common.select_lang(docs_rs).format(module_name=self.get_rust_module_name())
        doc += self.get_rust_examples()
        doc += self.get_rust_api()

        return doc
Beispiel #8
0
    def get_go_doc(self):
        docs_rs = {'en': 'Additional documentation can be found on `godoc.org <https://godoc.org/github.com/Tinkerforge/go-api-bindings/{device_name_under}>`_.\n',
                   'de': 'Zusätzliche Dokumentation findet sich auf `godoc.org <https://godoc.org/github.com/Tinkerforge/go-api-bindings/{device_name_under}>`_.\n'}

        doc  = common.make_rst_header(self)
        doc += common.make_rst_summary(self)
        doc += common.select_lang(docs_rs).format(device_name_under=self.get_go_package())
        doc += self.get_go_examples()
        doc += self.get_go_api()

        return doc
Beispiel #9
0
    def get_openhab_doc(self):
        doc = common.make_rst_header(self,
                                     has_device_identifier_constant=False)
        doc += common.make_rst_summary(self)
        if self.oh.doc is not None:
            doc += self.oh.doc
            doc += '\n\n'
        examples = self.get_openhab_examples()
        doc += examples
        doc += '\n\n'
        doc += self.get_openhab_configuration()
        doc += '\n\n'
        doc += self.get_openhab_channels()
        doc += '\n\n'
        doc += """{example_marker}Actions
-------

Actions can be used in rules by creating an action object. All actions return a Map<String, Object>.
Returned values can be accessed by name, sometimes the type deduction needs some hints, as shown below:

.. code-block:: none

 val actions = getActions("tinkerforge", "tinkerforge:{device_lower}:[UID]")
 val hwVersion = actions.{device_headless}GetIdentity().get("hardwareVersion") as short[]
 logInfo("Example", "Hardware version: " + hwVersion.get(0) + "." + hwVersion.get(1) + "." + hwVersion.get(2))

""".format(example_marker=''
           if len(examples) > 0 else '.. _{0}_{1}_examples:\n\n'.format(
               self.get_doc_rst_ref_name(),
               self.get_generator().get_bindings_name()),
           device_lower=self.get_category().lower_no_space +
           self.get_name().lower_no_space,
           device_headless=self.get_category().headless +
           self.get_name().camel)

        for type_, caption in [('bf', 'Basic Actions'),
                               ('af', 'Advanced Actions'),
                               ('ccf',
                                'Trigger Channel Configuration Actions'),
                               ('vf', 'Virtual Actions'),
                               ('if', 'Internal Actions')]:
            actions = self.get_openhab_actions(type_)
            if len(actions) > 0:
                doc += "{}\n{}\n\n".format(caption, '^' * len(caption))
                doc += actions

        return doc