class DenoiseProperty(PropertyView):
    """Value of integration_time"""

    schema = fields.Int(required=True, minimum=100, maximum=500)
    semtype = "LevelProperty"

    @op.readproperty
    def get(self):
        # When a GET request is made, we'll find our attached component
        my_component = find_component("org.labthings.example.mycomponent")
        return my_component.integration_time

    @op.writeproperty
    def put(self, new_property_value):
        # Find our attached component
        my_component = find_component("org.labthings.example.mycomponent")

        # Apply the new value
        my_component.integration_time = new_property_value

        return my_component.integration_time
示例#2
0
 class TestSchema(Schema):
     test_regexp = fields.Int(validate=validate.Regexp(r"\d+"))
示例#3
0
    class Index(ActionView):
        args = {"integer": fields.Int()}
        semtype = "ToggleAction"

        def post(self):
            return "POST"
示例#4
0
    class Index(ActionView):
        schema = fields.Int()
        response_content_type = "text/plain; charset=us-ascii"

        def post(self):
            return "POST"
示例#5
0
    class Index(PropertyView):
        schema = fields.Int()

        def put(self):
            return "PUT"
示例#6
0
    class Index(PropertyView):
        schema = fields.Int(required=True)

        def get(self):
            return "GET"